mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Barry Song <21cnbao@gmail.com>
Cc: Tobias Klauser <tklauser@distanz.ch>,
	Yury Norov <yury.norov@gmail.com>,
	"Song Bao Hua (Barry Song)" <song.bao.hua@hisilicon.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	"tiantao (H)" <tiantao6@hisilicon.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpumask: Omit terminating null byte in cpumap_print_{list,bitmask}_to_buf
Date: Sun, 19 Sep 2021 09:52:26 +0200	[thread overview]
Message-ID: <YUbsOtEQ4la3hfrf@kroah.com> (raw)
In-Reply-To: <CAGsJ_4wftev=z1tf7fzVKS5wRPneWSOimSxG+E0qy2CGuRykKQ@mail.gmail.com>

On Sun, Sep 19, 2021 at 07:33:52PM +1200, Barry Song wrote:
> On Sat, Sep 18, 2021 at 1:27 AM Tobias Klauser <tklauser@distanz.ch> wrote:
> >
> > On 2021-09-17 at 01:19:04 +0200, Yury Norov <yury.norov@gmail.com> wrote:
> > > [CC Greg KH <gregkh@linuxfoundation.org>]
> > >
> > > On Thu, Sep 16, 2021 at 10:53:39PM +0000, Song Bao Hua (Barry Song) wrote:
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Tobias Klauser [mailto:tklauser@distanz.ch]
> > > > > Sent: Friday, September 17, 2021 10:27 AM
> > > > > To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Jonathan Cameron
> > > > > <jonathan.cameron@huawei.com>; tiantao (H) <tiantao6@hisilicon.com>; Song Bao
> > > > > Hua (Barry Song) <song.bao.hua@hisilicon.com>
> > > > > Cc: Andrew Morton <akpm@linux-foundation.org>; Andy Shevchenko
> > > > > <andriy.shevchenko@linux.intel.com>; Yury Norov <yury.norov@gmail.com>; Peter
> > > > > Zijlstra <peterz@infradead.org>; linux-kernel@vger.kernel.org
> > > > > Subject: [PATCH] cpumask: Omit terminating null byte in
> > > > > cpumap_print_{list,bitmask}_to_buf
> > > > >
> > > > > The changes in the patch series [1] introduced a terminating null byte
> > > > > when reading from cpulist or cpumap sysfs files, for example:
> > > > >
> > > > >   $ xxd /sys/devices/system/node/node0/cpulist
> > > > >   00000000: 302d 310a 00                             0-1..
> > > > >
> > > > > Before this change, the output looked as follows:
> > > > >
> > > > >   $ xxd /sys/devices/system/node/node0/cpulist
> > > > >   00000000: 302d 310a                                0-1.
> > > >
> > > > If we don't use xxd, I don't see any actual harm of this NULL byte
> > > > by cat, lscpu, numactl etc. this doesn't break them at all.
> > >
> > > Barry, Tobias' script that uses xxd is userspace. Linux kernel never breaks
> > > userspace.
> >
> > FWIW, the example using xxd was just to illustrate the issue in a
> > concise way for the commit message. This is breaking other userspace
> > programs as well. Originally, I discovered this because Kubernetes'
> > kubelet was crashing on a bpf-next kernel. See [1] and following
> > comments for more information:
> >
> > [1] https://github.com/cilium/cilium/pull/17394#issuecomment-920902042
> >
> 
> cat, lscpu, numactl tools were tested. the above was not in the test cases.
> Anyway, if some apps depend on the last character, this patch makes
> sense. we need this one. sorry for missing the test case.
> 
> Acked-by: Barry Song <song.bao.hua@hisilicon.com>
> 
> Greg, can you please help merge this one into 5.15?

Yes, will apply it to my tree soon.

thanks,

greg k-h

  reply	other threads:[~2021-09-19  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 22:27 Tobias Klauser
2021-09-16 22:53 ` Song Bao Hua (Barry Song)
2021-09-16 23:19   ` Yury Norov
2021-09-17  8:45     ` Tobias Klauser
2021-09-19  7:33       ` Barry Song
2021-09-19  7:52         ` Greg Kroah-Hartman [this message]
2021-09-30 10:30 ` Antti Kervinen
2021-09-30 10:43   ` Greg KH
2021-09-30 12:29     ` Antti Kervinen
2021-09-30 10:46   ` Barry Song

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=YUbsOtEQ4la3hfrf@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=tiantao6@hisilicon.com \
    --cc=tklauser@distanz.ch \
    --cc=yury.norov@gmail.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

all inboxes | Powered by JetHome®