bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf v4 0/2] bpf, sockmap: fix potential memory leak
@ 2021-07-12 19:55 John Fastabend
  2021-07-12 19:55 ` [PATCH bpf v4 1/2] bpf, sockmap: fix potential memory leak on unlikely error case John Fastabend
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: John Fastabend @ 2021-07-12 19:55 UTC (permalink / raw)
  To: ast, jakub, daniel, andriin, xiyou.wangcong; +Cc: bpf, netdev, john.fastabend

While investigating a memleak in sockmap I found these two issues. Patch
1 found doing code review, I wasn't able to get KASAN to trigger a
memleak here, but should be necessary. Patch 2 fixes proc stats so when
we use sockstats for debugging we get correct values.

The fix for observered memleak will come after these, but requires some
more discussion and potentially patch revert so I'll try to get the set
here going now.

v4: fix both users of sk_psock_skb_ingress_enqueue and then fix the
    inuse idx by moving init hook later after tcp/udp init calls.
v3: move kfree into same function as kalloc

John Fastabend (2):
  bpf, sockmap: fix potential memory leak on unlikely error case
  bpf, sockmap: sk_prot needs inuse_idx set for proc stats

 net/core/skmsg.c    | 16 +++++++++++-----
 net/core/sock_map.c | 11 ++++++++++-
 2 files changed, 21 insertions(+), 6 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-15 18:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 19:55 [PATCH bpf v4 0/2] bpf, sockmap: fix potential memory leak John Fastabend
2021-07-12 19:55 ` [PATCH bpf v4 1/2] bpf, sockmap: fix potential memory leak on unlikely error case John Fastabend
2021-07-14  0:35   ` Cong Wang
2021-07-12 19:55 ` [PATCH bpf v4 2/2] bpf, sockmap: sk_prot needs inuse_idx set for proc stats John Fastabend
2021-07-13  7:47   ` Jakub Sitnicki
2021-07-14  0:56   ` Cong Wang
2021-07-13  7:47 ` [PATCH bpf v4 0/2] bpf, sockmap: fix potential memory leak Jakub Sitnicki
2021-07-15 18:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).