BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] bpf: Fix an issue in bpf_iter_task
@ 2024-02-08  9:09 Yafang Shao
  2024-02-08  9:09 ` [PATCH bpf-next 1/3] bpf: Fix an issue due to uninitialized bpf_iter_task Yafang Shao
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Yafang Shao @ 2024-02-08  9:09 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa
  Cc: bpf, Yafang Shao

The uninitialized bpf_iter_task variable poses a risk of triggering a
kernel panic. To fix this potential issue, it's imperative to ensure proper
initialization of the variable. This problem surfaced during the
implementation phase of the bits iterator [0]. 

[0]. https://lwn.net/ml/bpf/CALOAHbDJWHOB+viBz6SUqdeF+Nkxmh4gLZo5Ad_keQXjBWHAsQ@mail.gmail.com 

Yafang Shao (3):
  bpf: Fix an issue due to uninitialized bpf_iter_task
  selftests/bpf: Add negtive test cases for task iter
  libbpf: Check the return value of bpf_iter_<type>_new()

 kernel/bpf/task_iter.c                         |  2 ++
 tools/lib/bpf/bpf_helpers.h                    | 16 ++++++++++++----
 tools/testing/selftests/bpf/prog_tests/iters.c |  1 +
 tools/testing/selftests/bpf/progs/iters_task.c | 12 +++++++++++-
 4 files changed, 26 insertions(+), 5 deletions(-)

-- 
2.39.1


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

end of thread, other threads:[~2024-02-08 18:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08  9:09 [PATCH bpf-next 0/3] bpf: Fix an issue in bpf_iter_task Yafang Shao
2024-02-08  9:09 ` [PATCH bpf-next 1/3] bpf: Fix an issue due to uninitialized bpf_iter_task Yafang Shao
2024-02-08  9:41   ` Chuyi Zhou
2024-02-08  9:48     ` Yafang Shao
2024-02-08 15:52     ` Yonghong Song
2024-02-08 17:21       ` Alexei Starovoitov
2024-02-08  9:09 ` [PATCH bpf-next 2/3] selftests/bpf: Add negtive test cases for task iter Yafang Shao
2024-02-08  9:09 ` [PATCH bpf-next 3/3] libbpf: Check the return value of bpf_iter_<type>_new() Yafang Shao
2024-02-08 17:43   ` Yonghong Song
2024-02-08 18:56     ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox