linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/4] Add some 'malloc' failure checks
@ 2024-05-10  9:57 kunwu.chan
  2024-05-10  9:58 ` [PATCH bpf-next v2 1/4] selftests/bpf: Add some null pointer checks kunwu.chan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: kunwu.chan @ 2024-05-10  9:57 UTC (permalink / raw)
  To: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, mykolal, shuah,
	kunwu.chan
  Cc: bpf, linux-kselftest, linux-kernel, Kunwu Chan

From: Kunwu Chan <chentao@kylinos.cn>

The "malloc" call may not be successful.Add the malloc
failure checking to avoid possible null dereference.

Changes since v1 [1]:
        - As Daniel Borkmann suggested, change patch 4/4 only
        - Other 3 patches no changes.

[1] https://lore.kernel.org/all/20240424020444.2375773-1-chentao@kylinos.cn/

Kunwu Chan (4):
  selftests/bpf: Add some null pointer checks
  selftests/bpf/sockopt: Add a null pointer check for the run_test
  selftests/bpf: Add a null pointer check for the load_btf_spec
  selftests/bpf: Add a null pointer check for the
    serial_test_tp_attach_query

 tools/testing/selftests/bpf/prog_tests/sockopt.c         | 6 ++++++
 tools/testing/selftests/bpf/prog_tests/tp_attach_query.c | 3 +++
 tools/testing/selftests/bpf/test_progs.c                 | 7 +++++++
 tools/testing/selftests/bpf/test_verifier.c              | 2 ++
 4 files changed, 18 insertions(+)

-- 
2.40.1


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

end of thread, other threads:[~2024-05-13  7:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10  9:57 [PATCH bpf-next v2 0/4] Add some 'malloc' failure checks kunwu.chan
2024-05-10  9:58 ` [PATCH bpf-next v2 1/4] selftests/bpf: Add some null pointer checks kunwu.chan
2024-05-10 11:20   ` Muhammad Usama Anjum
2024-05-13  7:00     ` Kunwu Chan
2024-05-13  7:52   ` Markus Elfring
2024-05-10  9:58 ` [PATCH bpf-next v2 2/4] selftests/bpf/sockopt: Add a null pointer check for the run_test kunwu.chan
2024-05-10 11:22   ` Muhammad Usama Anjum
2024-05-10  9:58 ` [PATCH bpf-next v2 3/4] selftests/bpf: Add a null pointer check for the load_btf_spec kunwu.chan
2024-05-10 11:23   ` Muhammad Usama Anjum
2024-05-10  9:58 ` [PATCH bpf-next v2 4/4] selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query kunwu.chan
2024-05-10 11:24   ` Muhammad Usama Anjum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).