public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Song Bao Hua (Barry Song)" <song.bao.hua@hisilicon.com>
Cc: "tiantao (H)" <tiantao6@hisilicon.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	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
Date: Tue, 1 Jun 2021 09:13:27 +0200	[thread overview]
Message-ID: <YLXeF8oxHgIxl2iF@kroah.com> (raw)
In-Reply-To: <cb90096ab76d4a55a59d0682fa786ba5@hisilicon.com>

On Tue, Jun 01, 2021 at 07:04:33AM +0000, Song Bao Hua (Barry Song) wrote:
> 
> 
> > -----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.

Ok, then create the new function and then convert to use it, do not
bundle it together in the same patch.

thanks,

greg k-h

  reply	other threads:[~2021-06-01  7:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  2:56 [PATCH 0/2] use bin_attribute to avoid buff overflow Tian Tao
2021-06-01  2:56 ` [PATCH 1/2] topology: " Tian Tao
2021-06-01  4:58   ` Greg KH
2021-06-01  7:04     ` Song Bao Hua (Barry Song)
2021-06-01  7:13       ` Greg KH [this message]
2021-06-02  6:14     ` tiantao (H)
2021-06-02  6:18       ` Greg KH
2021-06-02  6:28         ` tiantao (H)
2021-06-02  8:48           ` Andy Shevchenko
2021-06-02  9:00             ` tiantao (H)
2021-06-02  9:06               ` Greg KH
2021-06-02  9:20                 ` Song Bao Hua (Barry Song)
2021-06-02  9:35                   ` Greg KH
2021-06-01  2:56 ` [PATCH 2/2] drivers/base/node.c: " Tian Tao
2021-06-01  5:01   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLXeF8oxHgIxl2iF@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=tiantao6@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox