bpf: Introduce MEM_RDONLY flag
authorHao Luo <haoluo@google.com>
Fri, 17 Dec 2021 00:31:48 +0000 (16:31 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 18 Dec 2021 21:27:41 +0000 (13:27 -0800)
commit20b2aff4bc15bda809f994761d5719827d66c0b4
tree56ef53fccf3a9be91909c3dc2cd36068043acc68
parentc25b2ae136039ffa820c26138ed4a5e5f3ab3841
bpf: Introduce MEM_RDONLY flag

This patch introduce a flag MEM_RDONLY to tag a reg value
pointing to read-only memory. It makes the following changes:

1. PTR_TO_RDWR_BUF -> PTR_TO_BUF
2. PTR_TO_RDONLY_BUF -> PTR_TO_BUF | MEM_RDONLY

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211217003152.48334-6-haoluo@google.com
include/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/map_iter.c
kernel/bpf/verifier.c
net/core/bpf_sk_storage.c
net/core/sock_map.c