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-12-08 10:12:58 +01:00
2021-11-08 03:29:52 +01:00
2021-12-03 10:58:13 -08:00
2021-12-08 14:31:16 -08:00
2021-11-08 11:55:21 -08:00
2021-11-29 13:02:00 +00:00
2021-11-08 12:07:52 -08:00
2021-12-02 16:53:16 -08:00
2021-11-17 14:52:44 +00:00
2021-11-22 08:41:56 -08:00
2021-11-10 11:36:43 -08:00
2021-12-03 18:24:21 -08:00
2021-11-18 13:57:09 +00:00
2021-12-02 15:08:22 +01:00
2021-11-12 11:53:16 -08:00
2021-11-10 16:45:54 -08:00
2021-11-23 19:13:00 +01:00
2021-11-06 13:30:34 -07:00
2021-11-06 14:08:17 -07:00
2021-11-09 11:20:07 -08:00
2021-11-09 10:02:49 -08:00
2021-12-18 13:27:23 -08:00
2021-12-16 14:57:10 -08:00
2021-12-16 14:57:10 -08:00
2021-12-18 13:27:41 -08:00
2021-11-12 10:19:09 -08:00
2021-12-10 15:56:13 -08:00
2021-11-17 10:36:15 -05:00
2021-12-03 10:58:13 -08:00
2021-12-16 14:57:10 -08:00
2021-11-06 13:30:39 -07:00
2021-11-07 10:38:17 -08:00
2021-11-07 10:38:17 -08:00
2021-11-06 14:08:17 -07:00
2021-11-09 10:02:49 -08:00
2021-11-06 13:30:38 -07:00
2021-11-09 10:02:52 -08:00
2021-11-06 13:30:46 -07:00
2021-11-09 10:02:49 -08:00
2021-11-11 07:37:31 -05:00
2021-11-22 12:31:49 +00:00
2021-12-13 22:28:27 +01:00
2021-11-17 10:36:35 -05:00
2021-11-09 10:02:49 -08:00
2021-11-09 10:02:49 -08:00
2021-11-09 19:19:34 -07:00
2021-11-06 14:08:17 -07:00
2021-12-02 15:35:57 +01:00
2021-11-18 15:05:56 -05:00
2021-11-20 10:35:54 -08:00
2021-11-09 10:02:48 -08:00
2021-11-15 07:53:10 -08:00
2021-12-07 20:44:58 -08:00
2021-12-07 20:44:58 -08:00
2021-12-06 16:05:11 -08:00
2021-11-09 10:02:49 -08:00
2021-11-11 22:45:40 +01:00
2021-11-06 13:30:36 -07:00
2021-11-20 10:35:54 -08:00
2021-11-06 14:36:12 -07:00
2021-11-09 10:02:51 -08:00
2021-11-06 14:08:17 -07:00
2021-11-11 13:09:33 +01:00
2021-11-06 13:30:43 -07:00
2021-12-01 21:04:34 -05:00
2021-11-18 02:11:57 -05:00
2021-11-18 02:03:45 -05:00
2021-11-12 08:05:17 +09:00
2021-11-09 10:02:49 -08:00
2021-11-09 10:02:49 -08:00
2021-11-14 12:21:53 +00:00
2021-11-14 12:21:53 +00:00
2021-11-26 18:31:46 +02:00
2021-11-10 11:29:30 -08:00
2021-11-06 14:08:17 -07:00
2021-11-06 13:30:42 -07:00
2021-11-06 13:30:42 -07:00
2021-11-06 13:30:41 -07:00
2021-11-06 13:30:41 -07:00
2021-11-11 09:34:35 -08:00
2021-11-18 11:29:40 +00:00
2021-11-06 14:08:17 -07:00
2021-11-06 13:30:40 -07:00
2021-11-11 22:45:40 +01:00
2021-12-06 16:06:02 -08:00
2021-11-11 09:50:30 +01:00
2021-12-10 06:38:26 -08:00
2021-11-10 21:16:56 +00:00
2021-12-06 16:06:02 -08:00
2021-11-05 14:54:40 -04:00
2021-11-05 14:54:39 -04:00
2021-11-06 13:30:42 -07:00
2021-11-16 19:07:53 -08:00
2021-11-11 09:34:35 -08:00
2021-11-17 10:36:35 -05:00
2021-11-17 10:36:35 -05:00
2021-11-14 10:38:27 -08:00
2021-11-18 10:50:45 -08:00
2021-12-16 14:57:09 -08:00
2021-12-09 13:23:02 -08:00
2021-12-09 11:21:03 -08:00
2021-11-09 10:02:49 -08:00
2021-11-18 10:03:47 +01:00
2021-11-26 11:38:20 -08:00
2021-11-09 10:02:49 -08:00
2021-12-06 16:04:44 -08:00
2021-11-15 13:27:13 +00:00
2021-11-10 09:05:11 -08:00
2021-11-09 10:02:49 -08:00
2021-11-09 10:11:53 -08:00
2021-11-14 12:21:53 +00:00
2021-12-10 06:38:26 -08:00
2021-11-09 10:02:52 -08:00
2021-11-09 10:11:53 -08:00
2021-12-02 11:44:56 -08:00
2021-12-09 11:54:24 -08:00
2021-11-16 13:10:34 +00:00
2021-11-06 13:30:43 -07:00
2021-11-06 13:30:32 -07:00
2021-11-09 10:02:49 -08:00
2021-11-09 10:11:53 -08:00
2021-11-09 10:02:50 -08:00
2021-11-06 13:30:43 -07:00
2021-11-30 11:57:58 +00:00
2021-11-09 10:02:50 -08:00
2021-11-06 14:08:17 -07:00
2021-12-07 11:36:30 -08:00
2021-11-14 21:21:08 -05:00
2021-11-11 13:09:33 +01:00
2021-11-17 14:50:45 +00:00
2021-11-24 18:47:27 -05:00
2021-11-06 13:30:36 -07:00
2021-12-08 17:58:59 -08:00
2021-11-08 16:55:32 -08:00
2021-11-08 16:55:32 -08:00
2021-11-08 16:55:32 -08:00