Skip to content

sockmap fix for KASAN_VMALLOC and af_unix

John Fastabend bpf netdev 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesNew
  2. v32 patches 0 repliesSuperseded
  3. v22 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches13 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: sockmap, af_unix stream sockets need to hold ref for pair sockinclude/linux/skmsg.h include/net/af_unix.h net/core/skmsg.c +2 more+9 -20 replies
2/2bpf: sockmap, add af_unix test with both sockets in maptools/testing/selftests/bpf/prog_tests/sockmap_listen.c tools/testing/selftests/bpf/progs/test_sockmap_listen.c+47 -110 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJakub Sitnicki
1/2R-b
2/2R-b

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

Read the v4 thread

Cover letter [PATCH bpf v4 0/2] sockmap fix for KASAN_VMALLOC and af_unix

The af_unix tests in sockmap_listen causes a splat from KASAN_VMALLOC. Fix it here and include an extra test to catch case where both pairs of the af_unix socket are included in a BPF sockmap.

Also it seems the test infra is not passing type through correctly when testing unix_inet_redir_to_connected. Unfortunately, the simple fix also caused some CI tests to fail so investigating that now.

v4: forgot to commit typo fix add that now (CI build failed)
v3: drop unnecessary assignment (Martin) and rebase on latest selftests.
v2: drop changes to dgram side its fine per Jakub's point it graps a
reference on the peer socket from each sendmsg.

John Fastabend (2):
bpf: sockmap, af_unix stream sockets need to hold ref for pair sock
bpf: sockmap, add af_unix test with both sockets in map

 include/linux/skmsg.h                         |  1 +
 include/net/af_unix.h                         |  1 +
 net/core/skmsg.c                              |  2 +
 net/unix/af_unix.c                            |  2 -
 net/unix/unix_bpf.c                           |  5 ++
 .../selftests/bpf/prog_tests/sockmap_listen.c | 51 +++++++++++++++----
 .../selftests/bpf/progs/test_sockmap_listen.c |  7 +++
 7 files changed, 56 insertions(+), 13 deletions(-)
Signature · 1 line
2.33.0