Skip to content

bpf fix for unconnect af_unix socket

John Fastabend bpf netdev 2 versions Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied 2/2
  2. v12 patches 5 repliesSuperseded

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: syzkaller found null ptr deref in unix_bpf proto addinclude/net/sock.h net/core/sock_map.c+7 -07 repliesApplied
2/2bpf: sockmap, test for unconnected af_unix socktools/testing/selftests/bpf/prog_tests/sockmap_basic.c+34 -00 repliesApplied

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJakub Sitnicki
SeriesA-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf v2 0/2] bpf fix for unconnect af_unix socket

Eric reported a syzbot splat from a null ptr deref from recent fix to resolve a use-after-free with af-unix stream sockets and BPF sockmap usage.

The issue is I missed is we allow unconnected af_unix STREAM sockets to be added to the sockmap. Fix this by blocking unconnected sockets.

v2: change sk_is_unix to sk_is_stream_unix (Eric) and remove duplicate
ASSERTS in selftests the xsocket helper already marks FAIL (Jakub)

John Fastabend (2):
bpf: syzkaller found null ptr deref in unix_bpf proto add
bpf: sockmap, test for unconnected af_unix sock

 include/net/sock.h                            |  5 +++
 net/core/sock_map.c                           |  2 ++
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 34 +++++++++++++++++++
 3 files changed, 41 insertions(+)
Signature · 1 line
2.33.0