[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7ce461f-9e8c-29a0-4376-f1a61742d9cb@huaweicloud.com>
Date: Mon, 14 Oct 2024 22:17:11 +0800
From: Xiu Jianfeng <xiujianfeng@...weicloud.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: tj@...nel.org, lizefan.x@...edance.com, hannes@...xchg.org,
roman.gushchin@...ux.dev, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, wangweiyang2@...wei.com
Subject: Re: [PATCH] cgroup: Fix potential overflow issue when checking
max_depth
Hi Michal,
On 2024/10/14 21:37, Michal Koutný wrote:
> Hello.
>
> On Sat, Oct 12, 2024 at 07:22:46AM GMT, Xiu Jianfeng <xiujianfeng@...weicloud.com> wrote:
>> 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.
>
> Strictly speaking the overflow would be undefined behavior (Out of curiousity --
> have you figured this out with a checker tool or code reading?)
Thanks for your review, I figured it out with code reading.
> Logically (neglecting UB), max_depth=INT_MAX would behave like intended
> (no limit).
Agreed, this is the real 'no limit'.
>
>> Fixes: 1a926e0bbab8 ("cgroup: implement hierarchy limits")
>> Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
>> ---
>> kernel/cgroup/cgroup.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Reviewed-by: Michal Koutný <mkoutny@...e.com>
Powered by blists - more mailing lists