lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [syzbot] [bpf?] KMSAN: uninit-value in strnchr
    Date
    please test uini in strnchr

    #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 04b8076df253

    diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
    index 449b9a5d3fe3..54abc67c48c7 100644
    --- a/kernel/bpf/helpers.c
    +++ b/kernel/bpf/helpers.c
    @@ -826,7 +826,8 @@ int bpf_bprintf_prepare(char *fmt, u32 fmt_size, const u64 *raw_args,
    u64 cur_arg;
    char fmt_ptype, cur_ip[16], ip_spec[] = "%pXX";

    - fmt_end = strnchr(fmt, fmt_size, 0);
    + kmsan_unpoison_memory(fmt, fmt_size);
    + fmt_end = strnchrnul(fmt, fmt_size, 0);
    if (!fmt_end)
    return -EINVAL;
    fmt_size = fmt_end - fmt;
    --
    2.43.0

    \
     
     \ /
      Last update: 2024-05-27 16:31    [W:3.231 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site