All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf 0/9] fixes for bpf map iterator
@ 2022-08-06  7:40 Hou Tao
  2022-08-06  7:40 ` [PATCH bpf 1/9] bpf: Acquire map uref in .init_seq_private for array " Hou Tao
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Hou Tao @ 2022-08-06  7:40 UTC (permalink / raw)
  To: bpf
  Cc: Andrii Nakryiko, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Yonghong Song, Song Liu, KP Singh,
	David S . Miller, Jakub Kicinski, Stanislav Fomichev, Hao Luo,
	Jiri Olsa, John Fastabend, Lorenz Bauer, houtao1

From: Hou Tao <houtao1@huawei.com>

Hi,

The patchset constitues three fixes for bpf map iterator:

(1) patch 1~4: fix user-after-free during reading map iterator fd
It is possible when both the corresponding link fd and map fd are
closed bfore reading the iterator fd. I had squashed these four patches
into one, but it was not friendly for stable backport, so I break these
fixes into 4 single patches in the end. Patch 7 is its testing patch.

(2) patch 5: fix invalidity check for values in sk local storage map
Patch 8 adds two tests for it.

(3) patch 6: reject sleepable program for non-resched map iterator
Patch 9 add a test for it.

Please check the individual patches for more details. And comments are
always welcome.

Regards,
Tao

Hou Tao (9):
  bpf: Acquire map uref in .init_seq_private for array map iterator
  bpf: Acquire map uref in .init_seq_private for hash map iterator
  bpf: Acquire map uref in .init_seq_private for sock local storage map
    iterator
  bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator
  bpf: Check the validity of max_rdwr_access for sk storage map iterator
  bpf: Only allow sleepable program for resched-able iterator
  selftests/bpf: Add tests for reading a dangling map iter fd
  selftests/bpf: Add write tests for sk storage map iterator
  selftests/bpf: Ensure sleepable program is rejected by hash map iter

 kernel/bpf/arraymap.c                         |   7 ++
 kernel/bpf/bpf_iter.c                         |  11 +-
 kernel/bpf/hashtab.c                          |   2 +
 net/core/bpf_sk_storage.c                     |  12 +-
 net/core/sock_map.c                           |  20 ++-
 .../selftests/bpf/prog_tests/bpf_iter.c       | 114 +++++++++++++++++-
 .../bpf/progs/bpf_iter_bpf_hash_map.c         |   9 ++
 .../bpf/progs/bpf_iter_bpf_sk_storage_map.c   |  20 ++-
 8 files changed, 189 insertions(+), 6 deletions(-)

-- 
2.29.2


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

end of thread, other threads:[~2022-08-10  1:35 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06  7:40 [PATCH bpf 0/9] fixes for bpf map iterator Hou Tao
2022-08-06  7:40 ` [PATCH bpf 1/9] bpf: Acquire map uref in .init_seq_private for array " Hou Tao
2022-08-08 14:53   ` Yonghong Song
2022-08-09  1:07     ` houtao
2022-08-06  7:40 ` [PATCH bpf 2/9] bpf: Acquire map uref in .init_seq_private for hash " Hou Tao
2022-08-08 14:54   ` Yonghong Song
2022-08-06  7:40 ` [PATCH bpf 3/9] bpf: Acquire map uref in .init_seq_private for sock local storage " Hou Tao
2022-08-08 14:54   ` Yonghong Song
2022-08-06  7:40 ` [PATCH bpf 4/9] bpf: Acquire map uref in .init_seq_private for sock{map,hash} iterator Hou Tao
2022-08-08 14:55   ` Yonghong Song
2022-08-06  7:40 ` [PATCH bpf 5/9] bpf: Check the validity of max_rdwr_access for sk storage map iterator Hou Tao
2022-08-08 14:56   ` Yonghong Song
2022-08-09 18:46   ` Martin KaFai Lau
2022-08-10  1:34     ` Hou Tao
2022-08-06  7:40 ` [PATCH bpf 6/9] bpf: Only allow sleepable program for resched-able iterator Hou Tao
2022-08-08 15:07   ` Yonghong Song
2022-08-06  7:40 ` [PATCH bpf 7/9] selftests/bpf: Add tests for reading a dangling map iter fd Hou Tao
2022-08-08 15:15   ` Yonghong Song
2022-08-09  1:23     ` houtao
2022-08-09 19:13       ` Martin KaFai Lau
2022-08-10  0:18         ` Yonghong Song
2022-08-06  7:40 ` [PATCH bpf 8/9] selftests/bpf: Add write tests for sk storage map iterator Hou Tao
2022-08-08 15:27   ` Yonghong Song
2022-08-09  1:26     ` houtao
2022-08-06  7:40 ` [PATCH bpf 9/9] selftests/bpf: Ensure sleepable program is rejected by hash map iter Hou Tao
2022-08-08 15:30   ` Yonghong Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.