lkml.org 
[lkml]   [2021]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 09/43] bpf: Support PTR_TO_MEM{,_OR_NULL} register spilling
    Date
    From: Gilad Reti <gilad.reti@gmail.com>

    commit 744ea4e3885eccb6d332a06fae9eb7420a622c0f upstream.

    Add support for pointer to mem register spilling, to allow the verifier
    to track pointers to valid memory addresses. Such pointers are returned
    for example by a successful call of the bpf_ringbuf_reserve helper.

    The patch was partially contributed by CyberArk Software, Inc.

    Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it")
    Suggested-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Gilad Reti <gilad.reti@gmail.com>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Acked-by: KP Singh <kpsingh@kernel.org>
    Link: https://lore.kernel.org/bpf/20210113053810.13518-1-gilad.reti@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    kernel/bpf/verifier.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/kernel/bpf/verifier.c
    +++ b/kernel/bpf/verifier.c
    @@ -2214,6 +2214,8 @@ static bool is_spillable_regtype(enum bp
    case PTR_TO_RDWR_BUF:
    case PTR_TO_RDWR_BUF_OR_NULL:
    case PTR_TO_PERCPU_BTF_ID:
    + case PTR_TO_MEM:
    + case PTR_TO_MEM_OR_NULL:
    return true;
    default:
    return false;

    \
     
     \ /
      Last update: 2021-01-22 15:59    [W:5.969 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site