Files
linux-st/include/linux
Hao Luo 216e3cd2f2 bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem.
Some helper functions may modify its arguments, for example,
bpf_d_path, bpf_get_stack etc. Previously, their argument types
were marked as ARG_PTR_TO_MEM, which is compatible with read-only
mem types, such as PTR_TO_RDONLY_BUF. Therefore it's legitimate,
but technically incorrect, to modify a read-only memory by passing
it into one of such helper functions.

This patch tags the bpf_args compatible with immutable memory with
MEM_RDONLY flag. The arguments that don't have this flag will be
only compatible with mutable memory types, preventing the helper
from modifying a read-only memory. The bpf_args that have
MEM_RDONLY are compatible with both mutable memory and immutable
memory.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211217003152.48334-9-haoluo@google.com
2021-12-18 13:27:41 -08:00
..
2021-11-23 19:13:00 +01:00
2021-11-12 10:19:09 -08:00
2021-11-17 10:36:15 -05:00
2021-11-17 10:36:35 -05:00
2021-11-15 07:53:10 -08:00
2021-11-06 14:08:17 -07:00
2021-11-10 21:16:56 +00:00
2021-11-16 19:07:53 -08:00
2021-11-17 10:36:35 -05:00
2021-11-16 13:10:34 +00:00
2021-11-06 13:30:43 -07:00
2021-12-08 17:58:59 -08:00