All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf 0/3] Pin the start cgroup for cgroup iterator
@ 2022-11-07  7:42 Hou Tao
  2022-11-07  7:42 ` [PATCH bpf 1/3] bpf: Pin the start cgroup in cgroup_iter_seq_init() Hou Tao
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Hou Tao @ 2022-11-07  7:42 UTC (permalink / raw)
  To: bpf, Hao Luo, Alexei Starovoitov, Stanislav Fomichev
  Cc: Martin KaFai Lau, Andrii Nakryiko, Song Liu, Yonghong Song,
	Daniel Borkmann, KP Singh, Jiri Olsa, John Fastabend, Tejun Heo,
	houtao1

From: Hou Tao <houtao1@huawei.com>

Hi,

The patchset tries to fix the potential use-after-free problem in cgroup
iterator. The problem is similar with the UAF problem fixed in map
iterator and the fixes is also similar: pinning the iterated resource
in .init_seq_private() and unpinning in .fini_seq_private(). Also adding
a test to demonstrate the problem.

Not sure whether or not it will be helpful to add some comments for
.init_seq_private() to state that the implementation of
.init_seq_private() should not depend on iterator link to guarantee
the liveness of iterated object. Comments are always welcome.

Hou Tao (3):
  bpf: Pin the start cgroup in cgroup_iter_seq_init()
  selftests/bpf: Add cgroup helper remove_cgroup()
  selftests/bpf: Add test for cgroup iterator on a dead cgroup

 kernel/bpf/cgroup_iter.c                      | 14 ++++
 tools/testing/selftests/bpf/cgroup_helpers.c  | 19 +++++
 tools/testing/selftests/bpf/cgroup_helpers.h  |  1 +
 .../selftests/bpf/prog_tests/cgroup_iter.c    | 78 +++++++++++++++++++
 4 files changed, 112 insertions(+)

-- 
2.29.2


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

end of thread, other threads:[~2022-11-09  9:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07  7:42 [PATCH bpf 0/3] Pin the start cgroup for cgroup iterator Hou Tao
2022-11-07  7:42 ` [PATCH bpf 1/3] bpf: Pin the start cgroup in cgroup_iter_seq_init() Hou Tao
2022-11-07 21:59   ` Yonghong Song
2022-11-08  2:11     ` Hao Luo
2022-11-08  4:08       ` Hou Tao
2022-11-08  7:03         ` Yonghong Song
2022-11-08 13:28           ` Hou Tao
2022-11-08 16:19             ` Yonghong Song
2022-11-09  9:30               ` Hou Tao
2022-11-08 18:10             ` Hao Luo
2022-11-07  7:42 ` [PATCH bpf 2/3] selftests/bpf: Add cgroup helper remove_cgroup() Hou Tao
2022-11-07 22:10   ` Yonghong Song
2022-11-07  7:42 ` [PATCH bpf 3/3] selftests/bpf: Add test for cgroup iterator on a dead cgroup Hou Tao
2022-11-07 22:44   ` Yonghong Song
2022-11-08  0:39     ` Hou Tao
2022-11-07 22:51 ` [PATCH bpf 0/3] Pin the start cgroup for cgroup iterator Yonghong Song
2022-11-08  0:46   ` Hou Tao

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.