Chuyi Zhou
3091b66749
bpf: Relax allowlist for css_task iter
...
The newly added open-coded css_task iter would try to hold the global
css_set_lock in bpf_iter_css_task_new, so the bpf side has to be careful in
where it allows to use this iter. The mainly concern is dead locking on
css_set_lock. check_css_task_iter_allowlist() in verifier enforced css_task
can only be used in bpf_lsm hooks and sleepable bpf_iter.
This patch relax the allowlist for css_task iter. Any lsm and any iter
(even non-sleepable) and any sleepable are safe since they would not hold
the css_set_lock before entering BPF progs context.
This patch also fixes the misused BPF_TRACE_ITER in
check_css_task_iter_allowlist which compared bpf_prog_type with
bpf_attach_type.
Fixes: 9c66dc94b6 ("bpf: Introduce css_task open-coded iterator kfuncs")
Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com >
Acked-by: Yonghong Song <yonghong.song@linux.dev >
Link: https://lore.kernel.org/r/20231031050438.93297-2-zhouchuyi@bytedance.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2023-11-01 22:49:20 -07:00
..
2023-11-01 22:49:20 -07:00
2023-11-01 22:33:53 -07:00
2023-09-22 09:50:55 -07:00
2023-09-04 13:20:19 -07:00
2023-11-01 13:15:54 -10:00
2023-08-23 10:32:39 +02:00
2023-10-30 13:44:35 -10:00
2023-11-01 11:25:08 -10:00
2023-08-18 10:18:58 -07:00
2023-10-30 17:27:56 -10:00
2023-06-09 23:29:50 +10:00
2023-06-05 13:56:52 +02:00
2023-10-30 18:01:41 -10:00
2023-08-29 09:39:08 -07:00
2023-10-31 15:38:12 -10:00
2023-10-11 12:58:14 +02:00
2023-10-23 15:24:11 +02:00
2023-11-01 15:28:33 -10:00
2023-10-31 05:10:11 -10:00
2023-11-01 22:33:53 -07:00
2023-09-11 15:05:50 +02:00
2023-09-12 16:09:32 -04:00
2023-10-25 22:29:47 -04:00
2023-08-15 18:16:14 -04:00
2023-07-21 12:17:25 -04:00
2023-08-15 18:16:14 -04:00
2023-10-13 18:34:46 +02:00
2022-09-26 19:46:09 -07:00
2023-08-08 16:48:47 -04:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2023-06-05 09:57:20 +02:00
2023-01-13 11:48:15 +01:00
2023-11-01 15:28:33 -10:00
2023-09-29 17:20:48 -07:00
2023-10-30 20:13:17 -10:00
2023-04-18 16:39:34 -07:00
2023-09-21 12:03:50 -06:00
2023-09-21 12:03:50 -06:00
2023-02-08 13:36:22 +01:00
2023-11-01 15:28:33 -10:00
2023-09-18 08:14:36 +02:00
2023-05-28 16:20:21 +09:00
2023-09-29 11:28:39 -07:00
2023-04-08 13:45:37 -07:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2022-12-01 15:53:05 -08:00
2022-11-12 18:47:36 -08:00
2023-08-29 17:32:32 -07:00
2022-11-15 00:42:02 -08:00
2023-08-25 15:00:36 -07:00
2023-10-19 11:02:48 +02:00
2023-08-24 16:25:14 -07:00
2023-06-09 17:44:17 -07:00
2023-08-24 16:25:13 -07:00
2023-08-30 09:16:56 -07:00
2022-09-11 21:55:06 -07:00
2023-10-09 16:59:47 +10:00
2023-03-24 20:10:59 -07:00
2023-10-18 23:59:54 +09:00
2023-06-08 12:27:20 -07:00
2023-08-24 16:25:14 -07:00
2023-08-18 10:18:59 -07:00
2022-09-11 21:55:12 -07:00
2023-06-28 15:51:08 -07:00
2023-04-08 13:45:38 -07:00
2023-08-21 11:29:12 -07:00
2023-03-14 17:06:44 +08:00
2023-09-15 11:28:08 +02:00
2023-07-10 12:47:01 -07:00
2023-08-21 13:37:59 -07:00
2023-08-21 13:37:59 -07:00
2023-09-19 13:21:33 -07:00
2022-09-11 21:55:12 -07:00
2023-04-16 14:23:07 +02:00
2022-10-04 15:59:36 +02:00
2023-08-18 10:18:55 -07:00
2023-02-17 14:58:01 -08:00
2022-12-27 12:52:12 +01:00
2023-07-14 15:02:57 -07:00
2022-11-09 18:06:35 +00:00
2023-08-17 12:32:15 -07:00
2023-11-01 15:28:33 -10:00
2023-10-30 17:56:53 -10:00
2023-05-15 13:45:00 +02:00
2023-07-13 15:21:50 +02:00
2023-04-20 11:36:35 +02:00
2023-09-11 23:59:47 -04:00
2022-10-17 16:41:16 +02:00
2023-11-01 15:28:33 -10:00
2023-07-17 12:53:21 -07:00
2022-09-08 16:56:45 -07:00
2023-11-01 15:28:33 -10:00
2023-09-19 13:21:32 -07:00
2023-09-24 17:24:01 +02:00
2023-02-18 14:34:36 -05:00
2023-08-15 15:26:17 -07:00
2023-06-29 15:19:43 -07:00
2023-09-13 14:59:24 +02:00
2023-10-11 08:46:01 -07:00
2023-10-11 08:46:01 -07:00
2023-04-13 11:49:35 -07:00
2023-06-08 15:43:09 -04:00
2023-10-09 16:59:48 +10:00
2023-06-19 16:25:28 -07:00
2023-06-09 17:44:21 -07:00
2023-08-18 10:19:00 -07:00
2023-08-07 15:57:22 -10:00
2023-10-17 23:49:19 -10:00