bpf: Support PTR_TO_MEM{,_OR_NULL} register spilling
authorGilad Reti <gilad.reti@gmail.com>
Wed, 13 Jan 2021 05:38:07 +0000 (07:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2021 15:03:58 +0000 (16:03 +0100)
commitde661caaee07fab787c4fdb7062d100273c38d80
treeb5cbe4cb84ced48dcabc940dbbc607c4f0a6491c
parent3ed29995c281762df98cccf86afbddbfb6a918ef
bpf: Support PTR_TO_MEM{,_OR_NULL} register spilling

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