Skip to content

potential memleak and use after free in bpf verifier

He Fengqing bpf lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: Move bpf_prog_clone_free into filter.h fileinclude/linux/filter.h kernel/bpf/core.c+16 -191 reply
2/3bpf: Fix a memory leak in an error handling path in 'bpf_patch_insn_data()'kernel/bpf/verifier.c+4 -10 replies
3/3bpf: Fix a use after free in bpf_check()include/linux/filter.h kernel/bpf/core.c kernel/bpf/verifier.c +1 more+49 -178 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [bpf-next 0/3] potential memleak and use after free in bpf verifier

While reading the code of bpf verifier, I found these two issues. Patch 1 move the bpf_prog_clone_free function into filter.h, so we can use it in other file. Patch 2 fix memleak in an error handling path in bpf_patch_insn_data function.
Patch 3 fix a use after free in bpf_check function.

He Fengqing (3):
bpf: Move bpf_prog_clone_free into filter.h file
bpf: Fix a memory leak in an error handling path in

    'bpf_patch_insn_data()'

bpf: Fix a use after free in bpf_check()

 include/linux/filter.h | 17 ++++++++++++-
 kernel/bpf/core.c      | 27 +++++---------------
 kernel/bpf/verifier.c  | 58 ++++++++++++++++++++++++++++++++----------
 net/core/filter.c      |  2 +-
 4 files changed, 68 insertions(+), 36 deletions(-)
Signature · 1 line
2.25.1