Xiu Jianfeng
3cc4e13bb1
cgroup: Fix potential overflow issue when checking max_depth
...
cgroup.max.depth is the maximum allowed descent depth below the current
cgroup. If the actual descent depth is equal or larger, an attempt to
create a new child cgroup will fail. However due to the cgroup->max_depth
is of int type and having the default value INT_MAX, the condition
'level > cgroup->max_depth' will never be satisfied, and it will cause
an overflow of the level after it reaches to INT_MAX.
Fix it by starting the level from 0 and using '>=' instead.
It's worth mentioning that this issue is unlikely to occur in reality,
as it's impossible to have a depth of INT_MAX hierarchy, but should be
be avoided logically.
Fixes: 1a926e0bba ("cgroup: implement hierarchy limits")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com >
Reviewed-by: Michal Koutný <mkoutny@suse.com >
Signed-off-by: Tejun Heo <tj@kernel.org >
2024-10-14 13:39:25 -10:00
..
2024-10-08 08:43:22 -10:00
2024-10-14 13:39:25 -10:00
2024-09-01 20:34:38 +09:00
2024-06-21 15:49:29 +01:00
2024-09-23 08:38:56 +02:00
2024-07-29 07:33:10 +05:30
2024-09-27 08:18:43 -07:00
2024-09-01 20:43:33 -07:00
2024-06-15 10:43:06 -07:00
2024-09-23 12:47:06 -07:00
2024-08-01 16:40:44 -07:00
2024-07-02 16:56:18 +02:00
2024-09-29 08:51:30 -07:00
2024-09-28 09:06:15 -07:00
2024-09-27 08:18:43 -07:00
2024-09-19 10:18:15 +02:00
2024-09-18 08:53:53 +02:00
2024-09-23 06:53:02 -10:00
2024-09-27 08:18:43 -07:00
2024-09-27 08:18:43 -07:00
2024-04-24 09:43:53 +02:00
2024-02-09 11:13:59 -10:00
2024-04-04 16:24:16 +02:00
2024-04-04 16:24:16 +02:00
2024-09-03 16:35:16 -04:00
2024-08-28 16:48:28 -04:00
2024-08-28 16:48:28 -04:00
2024-06-24 22:24:55 -07:00
2024-04-29 08:29:29 -07:00
2024-08-15 21:30:43 +05:30
2024-09-17 07:25:37 +02:00
2024-09-01 20:43:37 -07:00
2024-09-01 20:43:30 -07:00
2024-02-23 17:33:31 -05:00
2024-07-24 20:59:29 +02:00
2024-02-23 17:48:22 -08:00
2024-09-21 07:29:05 -07:00
2024-09-25 11:35:19 -07:00
2024-08-17 11:06:44 +02:00
2024-05-30 01:13:20 +09:00
2024-07-24 20:59:29 +02:00
2024-09-10 11:57:27 +02:00
2024-07-20 16:33:21 +09:00
2024-08-15 09:33:35 -07:00
2024-08-15 09:33:35 -07:00
2024-02-23 17:48:22 -08:00
2024-08-01 07:08:01 -10:00
2024-09-17 12:40:34 +02:00
2024-07-24 20:59:29 +02:00
2024-09-01 17:59:01 -07:00
2024-09-01 20:43:23 -07:00
2024-04-23 14:59:01 +10:00
2024-08-05 14:04:03 +09:00
2024-07-29 10:45:54 -07:00
2024-09-10 09:51:14 +02:00
2024-07-24 20:59:29 +02:00
2024-09-03 21:15:26 -07:00
2024-08-12 22:00:43 -04:00
2024-09-16 06:28:28 +02:00
2024-09-19 10:18:15 +02:00
2023-12-01 09:51:44 -08:00
2024-07-24 20:59:29 +02:00
2024-07-24 20:59:29 +02:00
2024-08-12 22:00:43 -04:00
2024-08-04 13:36:28 -07:00
2024-02-22 15:38:52 -08:00
2024-04-24 09:43:53 +02:00
2024-04-25 21:07:03 -07:00
2024-09-27 08:18:43 -07:00
2024-09-17 01:07:00 -07:00
2024-09-21 07:29:05 -07:00
2024-05-30 15:31:51 -07:00
2024-07-24 20:59:29 +02:00
2024-09-26 11:39:02 -07:00
2024-08-15 00:06:48 +05:30
2024-08-20 17:13:40 +02:00
2024-07-24 20:59:29 +02:00
2023-12-29 12:22:29 -08:00
2024-09-06 16:29:22 +02:00
2024-08-15 21:30:42 +05:30
2024-07-18 12:19:20 -07:00
2024-09-23 09:35:36 -07:00
2024-06-03 15:20:37 +02:00
2024-07-24 20:59:29 +02:00
2024-07-29 12:05:06 -07:00
2024-08-12 22:00:43 -04:00
2024-05-30 15:31:38 -07:00
2024-09-25 23:23:44 +09:00
2024-07-12 16:39:53 -07:00
2024-05-17 17:31:24 -07:00
2024-07-24 20:59:29 +02:00
2024-09-09 16:47:42 -07:00
2024-09-12 12:16:09 +02:00
2024-07-24 20:59:29 +02:00
2024-05-22 08:31:15 -04:00
2024-09-03 21:15:43 -07:00
2024-08-12 22:00:43 -04:00
2024-07-17 21:11:34 -07:00
2024-09-01 20:43:32 -07:00
2024-09-18 06:59:44 +02:00