diff options
author | Hao Luo <haoluo@google.com> | 2021-12-16 16:31:48 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-12-18 13:27:41 -0800 |
commit | 20b2aff4bc15bda809f994761d5719827d66c0b4 (patch) | |
tree | 56ef53fccf3a9be91909c3dc2cd36068043acc68 /kernel/bpf/map_iter.c | |
parent | c25b2ae136039ffa820c26138ed4a5e5f3ab3841 (diff) |
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
Diffstat (limited to 'kernel/bpf/map_iter.c')
-rw-r--r-- | kernel/bpf/map_iter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c index 631f0e44b7a9..b0fa190b0979 100644 --- a/kernel/bpf/map_iter.c +++ b/kernel/bpf/map_iter.c @@ -174,9 +174,9 @@ static const struct bpf_iter_reg bpf_map_elem_reg_info = { .ctx_arg_info_size = 2, .ctx_arg_info = { { offsetof(struct bpf_iter__bpf_map_elem, key), - PTR_TO_RDONLY_BUF | PTR_MAYBE_NULL }, + PTR_TO_BUF | PTR_MAYBE_NULL | MEM_RDONLY }, { offsetof(struct bpf_iter__bpf_map_elem, value), - PTR_TO_RDWR_BUF | PTR_MAYBE_NULL }, + PTR_TO_BUF | PTR_MAYBE_NULL }, }, }; |