[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YyxA1Q9SEqFJJk8Y@kroah.com>
Date: Thu, 22 Sep 2022 13:02:45 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Phil Auld <pauld@...hat.com>
Cc: Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org,
"Rafael J . Wysocki" <rafael@...nel.org>,
Barry Song <21cnbao@...il.com>,
Tian Tao <tiantao6@...ilicon.com>,
feng xiangjun <fengxj325@...il.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2] drivers/base: Fix unsigned comparison to -1 in
CPUMAP_FILE_MAX_BYTES
On Tue, Sep 06, 2022 at 06:19:23PM -0400, Phil Auld wrote:
> On Tue, Sep 06, 2022 at 01:59:53PM -0700 Yury Norov wrote:
> > On Tue, Sep 06, 2022 at 04:35:42PM -0400, Phil Auld wrote:
> > > As PAGE_SIZE is unsigned long, -1 > PAGE_SIZE when NR_CPUS <= 3.
> > > This leads to very large file sizes:
> > >
> > > topology$ ls -l
> > > total 0
> > > -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 core_cpus
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 core_cpus_list
> > > -r--r--r-- 1 root root 4096 Sep 5 10:58 core_id
> > > -r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 core_siblings
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 core_siblings_list
> > > -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 die_cpus
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 die_cpus_list
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 die_id
> > > -r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 package_cpus
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 package_cpus_list
> > > -r--r--r-- 1 root root 4096 Sep 5 10:58 physical_package_id
> > > -r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 thread_siblings
> > > -r--r--r-- 1 root root 4096 Sep 5 11:59 thread_siblings_list
> > >
> > > Adjust the inequality to catch the case when NR_CPUS is configured
> > > to a small value.
> > >
> > > Fixes: 7ee951acd31a ("drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist")
> > > Reported-by: feng xiangjun <fengxj325@...il.com>
> > > Signed-off-by: Phil Auld <pauld@...hat.com>
> > > Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > > Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> > > Cc: Yury Norov <yury.norov@...il.com>
> > > Cc: stable@...r.kernel.org
> > > Cc: feng xiangjun <fengxj325@...il.com>
> >
> > Applied on bitmap-for-next. Thanks!
> >
>
> Great, thanks!
This is hitting people already and causing problems, so I'll go add it
to my tree as well to get it to Linus quicker. Here's one report of the
problem:
https://github.com/util-linux/util-linux/issues/1810
thanks,
greg k-h
Powered by blists - more mailing lists