-
Notifications
You must be signed in to change notification settings - Fork 151
selftests/bpf: use ASSERT_STRNEQ to factor in long slab cache names #10325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
|
Upstream branch: 7dc211c |
|
Upstream branch: 7dc211c |
c9206e7 to
8be2ac6
Compare
1efb39d to
5b97b4a
Compare
|
Upstream branch: ec12ab2 |
8be2ac6 to
4000b4f
Compare
5b97b4a to
7b6b51d
Compare
|
Upstream branch: d6ec090 |
4000b4f to
b79243a
Compare
7b6b51d to
2412df8
Compare
subtest_kmem_cache_iter_check_slabinfo() fundamentally compares slab cache names parsed out from /proc/slabinfo against those stored within struct kmem_cache_result. The current problem is that the slab cache name within struct kmem_cache_result is stored within a bounded fixed-length array (sized to SLAB_NAME_MAX(32)), whereas the name parsed out from /proc/slabinfo is not. Meaning, using ASSERT_STREQ() can certainly lead to test failures, particularly when dealing with slab cache names that are longer than SLAB_NAME_MAX(32) bytes. Notably, kmem_cache_create() allows callers to create slab caches with somewhat arbitrarily sized names via its __name identifier argument, so exceeding the SLAB_NAME_MAX(32) limit that is in place now can certainly happen. Make subtest_kmem_cache_iter_check_slabinfo() more reliable by only checking up to sizeof(struct kmem_cache_result.name) - 1 using ASSERT_STRNEQ(). Fixes: a496d0c ("selftests/bpf: Add a test for kmem_cache_iter") Signed-off-by: Matt Bobrowski <[email protected]> Acked-by: Song Liu <[email protected]>
|
Upstream branch: d6ec090 |
b79243a to
9bfe8f1
Compare
Pull request for series with
subject: selftests/bpf: use ASSERT_STRNEQ to factor in long slab cache names
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1024702