Chen Ridong
43151f8128
cgroup/dmem: fix NULL pointer dereference when setting max
An issue was triggered:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1] SMP NOPTI
CPU: 15 UID: 0 PID: 658 Comm: bash Tainted: 6.19.0-rc6-next-2026012
Tainted: [O]=OOT_MODULE
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
RIP: 0010:strcmp+0x10/0x30
RSP: 0018:ffffc900017f7dc0 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888107cd4358
RDX: 0000000019f73907 RSI: ffffffff82cc381a RDI: 0000000000000000
RBP: ffff8881016bef0d R08: 000000006c0e7145 R09: 0000000056c0e714
R10: 0000000000000001 R11: ffff888107cd4358 R12: 0007ffffffffffff
R13: ffff888101399200 R14: ffff888100fcb360 R15: 0007ffffffffffff
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000105c79000 CR4: 00000000000006f0
Call Trace:
<TASK>
dmemcg_limit_write.constprop.0+0x16d/0x390
? __pfx_set_resource_max+0x10/0x10
kernfs_fop_write_iter+0x14e/0x200
vfs_write+0x367/0x510
ksys_write+0x66/0xe0
do_syscall_64+0x6b/0x390
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f42697e1887
It was trriggered setting max without limitation, the command is like:
"echo test/region0 > dmem.max". To fix this issue, add check whether
options is valid after parsing the region_name.
Fixes: b168ed458d ("kernel/cgroup: Add "dmem" memory accounting cgroup")
Cc: stable@vger.kernel.org # v6.14+
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2026-02-02 06:02:42 -10:00
..
2025-12-05 14:36:21 -08:00
2026-02-02 06:02:42 -10:00
2025-11-12 10:00:14 -08:00
2025-10-24 12:56:20 +02:00
2025-12-06 09:25:05 -08:00
2025-11-04 08:35:37 +01:00
2025-12-01 20:42:01 -08:00
2025-12-02 08:01:39 -08:00
2025-11-09 21:19:44 -08:00
2025-12-05 17:29:04 -08:00
2025-10-02 08:31:44 -07:00
2025-12-03 13:46:48 -08:00
2025-11-27 14:24:44 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 14:01:20 -08:00
2025-11-28 16:50:45 +01:00
2025-12-05 17:29:04 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 12:31:21 -08:00
2025-12-05 17:29:04 -08:00
2025-12-06 13:49:40 -08:00
2025-10-29 10:29:58 +01:00
2025-06-24 20:30:37 +09:00
2025-11-04 12:36:49 +01:00
2025-09-23 12:37:35 +02:00
2025-10-03 10:19:44 -07:00
2025-09-23 12:37:35 +02:00
2025-09-10 19:55:00 -04:00
2025-10-22 19:28:06 -04:00
2025-11-07 16:38:34 -05:00
2025-11-07 16:50:42 -05:00
2025-12-03 16:53:19 +01:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2025-03-04 18:44:29 -08:00
2025-11-14 10:01:52 +01:00
2025-11-25 19:45:40 +01:00
2025-09-13 17:32:55 -07:00
2025-11-15 10:52:01 -08:00
2025-05-21 10:48:21 -07:00
2025-11-12 10:00:15 -08:00
2025-12-01 13:45:41 -08:00
2025-05-27 19:40:33 -07:00
2025-12-06 14:01:20 -08:00
2025-12-06 14:01:20 -08:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2025-11-20 14:03:43 -08:00
2025-02-21 15:05:38 +01:00
2025-01-13 22:40:36 -08:00
2025-03-10 11:54:46 +01:00
2025-09-28 11:36:14 -07:00
2025-11-24 16:56:24 +01:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-11-27 14:24:33 -08:00
2025-09-17 16:25:41 +02:00
2025-09-13 17:32:44 -07:00
2025-11-27 14:24:42 -08:00
2025-03-16 22:30:47 -07:00
2025-09-13 17:32:43 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2024-12-24 09:46:49 +01:00
2025-07-15 18:45:34 +09:00
2025-11-27 15:44:53 +01:00
2025-11-27 14:24:42 -08:00
2025-10-16 11:13:53 +02:00
2025-01-28 13:48:37 +01:00
2025-11-27 14:24:33 -08:00
2025-11-11 10:01:31 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 18:15:49 +08:00
2025-12-06 14:01:20 -08:00
2025-08-16 21:47:25 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-11-11 10:01:32 +01:00
2025-11-04 08:30:50 +01:00
2025-04-01 10:06:52 -07:00
2025-11-16 17:28:11 -08:00
2025-11-27 14:24:45 -08:00
2025-11-04 08:34:39 +01:00
2024-11-14 16:09:51 -08:00
2025-11-12 10:00:13 -08:00
2025-09-30 11:11:21 -07:00
2025-11-25 19:45:40 +01:00
2025-11-19 18:06:50 +01:00
2025-06-13 08:47:20 +02:00
2025-09-17 16:25:41 +02:00
2025-03-30 15:44:36 -07:00
2025-07-01 15:02:03 +02:00
2025-08-21 20:09:20 +02:00
2025-10-02 18:44:54 -07:00
2025-04-14 14:13:41 +02:00
2025-11-27 15:45:38 +01:00
2025-10-29 10:29:54 +01:00
2025-08-14 15:26:30 -07:00
2025-03-21 15:30:10 -04:00
2025-08-19 13:38:20 +02:00
2025-08-02 12:01:38 -07:00
2025-01-28 13:48:37 +01:00
2025-09-25 09:23:54 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2025-09-21 17:44:20 -04:00
2025-11-27 14:24:44 -08:00
2025-11-19 12:17:28 +01:00
2025-07-31 11:28:03 -04:00
2025-09-13 17:32:53 -07:00
2025-12-06 14:01:20 -08:00
2025-11-21 09:45:36 -10:00