Commit Graph

1 Commits

Author SHA1 Message Date
Artem Savkov c0df1b798d selftests/bpf: Add test for prealloc_lru_pop bug
Bugzilla: https://bugzilla.redhat.com/2137876

commit de7b9927105bd2afe940c6ad22de6938edd8b1c1
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Date:   Tue Aug 9 23:30:33 2022 +0200

    selftests/bpf: Add test for prealloc_lru_pop bug
    
    Add a regression test to check against invalid check_and_init_map_value
    call inside prealloc_lru_pop.
    
    The kptr should not be reset to NULL once we set it after deleting the
    map element. Hence, we trigger a program that updates the element
    causing its reuse, and checks whether the unref kptr is reset or not.
    If it is, prealloc_lru_pop does an incorrect check_and_init_map_value
    call and the test fails.
    
    Acked-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Link: https://lore.kernel.org/r/20220809213033.24147-4-memxor@gmail.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2023-01-05 15:46:46 +01:00