Qing Ming
8817005efb
cgroup/rstat: validate cpu before css_rstat_cpu() access
...
css_rstat_updated() is exposed as a BPF kfunc and accepts a
caller-provided cpu argument. The function uses cpu for per-cpu rstat
lookups without checking whether it refers to a valid possible CPU.
A BPF iter/cgroup program with CAP_BPF and CAP_PERFMON can pass an
invalid cpu value. On an unfixed UBSCAN_BOUNDS test kernel, cpu ==
0x7fffffff triggers:
UBSAN: array-index-out-of-bounds in kernel/cgroup/rstat.c:31:9
index 2147483647 is out of range for type 'long unsigned int [64]'
Call Trace:
css_rstat_updated
bpf_iter_run_prog
cgroup_iter_seq_show
bpf_seq_read
Add cpu validation to the BPF-facing css_rstat_updated() kfunc and
move the common implementation to __css_rstat_updated() for in-kernel
callers.
Fixes: a319185be9 ("cgroup: bpf: enable bpf programs to integrate with rstat")
Signed-off-by: Qing Ming <a0yami@mailbox.org >
Signed-off-by: Tejun Heo <tj@kernel.org >
2026-05-18 09:31:52 -10:00
..
2026-04-15 12:59:16 -07:00
2026-04-05 13:53:18 -07:00
2026-04-05 13:53:06 -07:00
2026-02-21 17:09:51 -08:00
2026-01-31 14:22:40 -08:00
2026-02-21 01:02:28 -08:00
2026-01-31 14:22:36 -08:00
2026-04-05 13:53:32 -07:00
2026-01-21 09:38:16 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-04 09:44:22 -08:00
2025-05-22 14:55:36 -07:00
2025-09-28 11:51:29 -07:00
2025-05-12 23:50:38 -07:00
2026-04-05 13:53:11 -07:00
2025-11-20 13:43:57 -08:00
2026-02-21 17:09:51 -08:00
2025-07-01 13:25:36 -06:00
2026-01-26 20:02:26 -08:00
2026-04-05 13:53:34 -07:00
2026-04-05 13:52:53 -07:00
2024-09-01 20:43:33 -07:00
2024-09-01 20:43:33 -07:00
2026-04-15 12:59:16 -07:00
2026-02-06 15:47:16 -08:00
2026-02-06 15:47:16 -08:00
2026-04-05 13:53:07 -07:00
2026-01-31 14:22:38 -08:00
2026-03-20 12:05:56 +01:00
2026-04-05 13:53:47 -07:00
2026-02-21 17:09:51 -08:00
2026-01-31 14:22:43 -08:00
2026-01-26 20:02:28 -08:00
2025-11-20 13:43:57 -08:00
2026-01-20 19:24:50 -08:00
2025-11-20 13:43:57 -08:00
2026-04-05 13:53:09 -07:00
2025-03-16 22:06:29 -07:00
2026-04-15 12:59:16 -07:00
2025-09-21 14:22:21 -07:00
2026-01-19 12:30:00 -08:00
2026-04-05 13:53:43 -07:00
2026-04-05 13:53:13 -07:00
2025-03-16 22:06:23 -07:00
2026-04-15 12:59:16 -07:00
2025-11-29 10:41:09 -08:00
2026-04-05 13:53:47 -07:00
2026-04-05 13:53:02 -07:00
2026-04-05 13:53:40 -07:00
2026-04-08 06:52:47 +10:00
2025-07-09 22:42:22 -07:00
2026-04-05 13:53:41 -07:00
2026-02-12 12:13:01 -08:00
2025-11-16 17:27:58 -08:00
2026-04-09 17:14:36 +02:00
2026-04-05 13:53:00 -07:00
2026-04-05 13:53:00 -07:00
2026-05-18 09:31:52 -10:00
2026-04-05 13:53:00 -07:00
2026-04-05 13:53:00 -07:00
2026-04-15 12:59:16 -07:00
2026-02-21 01:02:28 -08:00
2026-04-05 13:53:33 -07:00
2026-04-05 13:53:45 -07:00
2026-04-15 12:59:16 -07:00
2026-02-21 17:09:51 -08:00
2026-01-26 19:03:48 -08:00
2026-01-09 11:53:51 +02:00
2026-04-05 13:53:19 -07:00
2026-04-05 13:53:47 -07:00
2025-11-24 15:08:52 -08:00
2026-04-05 13:53:41 -07:00
2026-04-05 13:53:34 -07:00
2026-01-31 14:22:51 -08:00
2026-04-05 13:53:40 -07:00
2026-04-05 13:53:05 -07:00
2026-04-15 12:59:16 -07:00
2025-09-13 16:55:07 -07:00
2026-04-05 13:53:41 -07:00
2026-04-05 13:53:40 -07:00
2026-04-05 13:53:41 -07:00
2026-04-05 13:53:28 -07:00
2025-08-20 16:31:23 +03:00
2026-02-21 09:58:22 -08:00
2025-05-12 23:50:38 -07:00
2026-04-05 13:53:17 -07:00
2026-04-05 13:53:36 -07:00
2025-03-17 00:05:35 -07:00
2026-01-21 12:51:48 +01:00
2025-01-13 22:40:31 -08:00
2026-04-05 13:53:02 -07:00
2026-04-05 13:53:35 -07:00
2026-01-31 14:22:42 -08:00
2026-02-21 01:02:28 -08:00
2026-04-05 13:53:17 -07:00
2026-01-26 20:02:35 -08:00
2026-04-05 13:53:03 -07:00
2026-04-15 12:59:16 -07:00
2026-04-05 13:53:37 -07:00
2024-07-10 12:14:54 -07:00
2025-09-21 14:22:04 -07:00
2025-07-13 16:38:23 -07:00
2025-11-16 17:27:54 -08:00
2026-01-31 14:22:52 -08:00
2026-04-05 13:53:35 -07:00
2024-11-05 16:56:23 -08:00
2025-11-16 17:27:52 -08:00
2026-02-12 11:32:37 -08:00
2026-04-05 13:53:33 -07:00
2025-01-13 22:40:38 -08:00
2026-04-05 13:53:18 -07:00
2026-02-21 01:02:28 -08:00
2026-04-15 12:59:16 -07:00
2026-04-08 06:52:47 +10:00
2026-01-26 20:02:25 -08:00
2026-04-05 13:53:05 -07:00
2026-02-10 09:10:00 +01:00
2026-04-15 12:59:16 -07:00
2026-04-13 13:23:36 +02:00
2026-04-05 13:53:34 -07:00
2026-04-05 13:53:33 -07:00
2025-03-17 22:06:58 -07:00
2026-04-05 13:53:37 -07:00
2026-04-05 13:52:59 -07:00
2026-04-05 13:53:07 -07:00
2026-04-05 13:52:59 -07:00
2026-04-15 12:59:16 -07:00
2026-04-05 13:53:07 -07:00
2025-11-13 11:01:08 +01:00
2026-04-05 13:53:41 -07:00
2026-04-05 13:53:45 -07:00
2026-04-05 13:53:40 -07:00
2025-10-02 18:18:33 -07:00
2026-02-12 15:42:53 -08:00
2026-04-15 12:59:16 -07:00
2026-04-05 13:53:44 -07:00
2026-04-05 13:53:34 -07:00
2026-02-21 17:09:51 -08:00
2026-04-05 13:53:35 -07:00
2026-04-15 12:59:16 -07:00
2026-04-05 13:52:58 -07:00
2025-09-21 14:21:59 -07:00
2026-04-05 13:53:34 -07:00
2026-04-05 13:53:02 -07:00