lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.7 124/376] selftests/bpf: Fix invalid memory reads in core_relo selftest
    Date
    From: Andrii Nakryiko <andriin@fb.com>

    [ Upstream commit 13c908495e5d51718a6da84ae925fa2aac056380 ]

    Another one found by AddressSanitizer. input_len is bigger than actually
    initialized data size.

    Fixes: c7566a69695c ("selftests/bpf: Add field existence CO-RE relocs tests")
    Signed-off-by: Andrii Nakryiko <andriin@fb.com>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Link: https://lore.kernel.org/bpf/20200429012111.277390-8-andriin@fb.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    tools/testing/selftests/bpf/prog_tests/core_reloc.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/testing/selftests/bpf/prog_tests/core_reloc.c b/tools/testing/selftests/bpf/prog_tests/core_reloc.c
    index 31e177adbdf1..084ed26a7d78 100644
    --- a/tools/testing/selftests/bpf/prog_tests/core_reloc.c
    +++ b/tools/testing/selftests/bpf/prog_tests/core_reloc.c
    @@ -392,7 +392,7 @@ static struct core_reloc_test_case test_cases[] = {
    .input = STRUCT_TO_CHAR_PTR(core_reloc_existence___minimal) {
    .a = 42,
    },
    - .input_len = sizeof(struct core_reloc_existence),
    + .input_len = sizeof(struct core_reloc_existence___minimal),
    .output = STRUCT_TO_CHAR_PTR(core_reloc_existence_output) {
    .a_exists = 1,
    .b_exists = 0,
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-06-19 17:24    [W:4.048 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site