Messages in this thread | | | From | "Song Bao Hua (Barry Song)" <> | Subject | RE: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow | Date | Tue, 1 Jun 2021 07:04:33 +0000 |
| |
> -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Tuesday, June 1, 2021 4:59 PM > To: tiantao (H) <tiantao6@hisilicon.com> > Cc: linux-kernel@vger.kernel.org; akpm@linux-foundation.org; Song Bao Hua > (Barry Song) <song.bao.hua@hisilicon.com>; Andy Shevchenko > <andriy.shevchenko@linux.intel.com>; Rafael J. Wysocki <rafael@kernel.org> > Subject: Re: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow > > On Tue, Jun 01, 2021 at 10:56:49AM +0800, Tian Tao wrote: > > Reading sys/devices/system/cpu/cpuX/topology/ returns cpu topology. > > However, the size of this file is limited to PAGE_SIZE because of the > > limitation for sysfs attribute. so we use bin_attribute instead of > > attribute to avoid NR_CPUS too big to cause buff overflow. > > > > This patch is based on the following discussion. > > https://www.spinics.net/lists/linux-doc/msg95921.html > > Please use lore.kernel.org for links as we have no control over other > sites to ensure that they will work in the future. Use the message id > in the link as well, so that if something were to happen to lore, we can > figure it out. > > Also, you are modifying a bunch of different files here, do you mean to > do it for all of them?
The plan is providing a common wrapper similar with cpumap_print_to_pagebuf so that all modules which have bitmap and list topology ABI can move to use it.
Right now, drivers/base/topology.c and drivers/base/node.c are the first two examples involved. We are still having around 40 other places in the todo list.
Thanks Barry
| |