diff options
author | Hou Tao <houtao1@huawei.com> | 2024-10-30 18:05:16 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-10-30 12:13:46 -0700 |
commit | ebafc1e535db19505aec3b94a4a641fe735a2eac (patch) | |
tree | fbf780dd9c3ca0a1197f6304c2a5a838c3f4ee40 /net/bpf/test_run.c | |
parent | e1339383675063ae4760d81ffe13a79981841b8d (diff) |
selftests/bpf: Add three test cases for bits_iter
Add more test cases for bits iterator:
(1) huge word test
Verify the multiplication overflow of nr_bits in bits_iter. Without
the overflow check, when nr_words is 67108865, nr_bits becomes 64,
causing bpf_probe_read_kernel_common() to corrupt the stack.
(2) max word test
Verify correct handling of maximum nr_words value (511).
(3) bad word test
Verify early termination of bits iteration when bits iterator
initialization fails.
Also rename bits_nomem to bits_too_big to better reflect its purpose.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20241030100516.3633640-6-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/bpf/test_run.c')
0 files changed, 0 insertions, 0 deletions