All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm: debug: Fix a width vs precision bug in printk
Date: Fri, 23 Nov 2018 14:36:06 +0000	[thread overview]
Message-ID: <20181123143605.GB2970@unbuntlaptop> (raw)
In-Reply-To: <20181123090125.GC8625@dhcp22.suse.cz>

On Fri, Nov 23, 2018 at 10:01:25AM +0100, Michal Hocko wrote:
> On Fri 23-11-18 10:21:35, Dan Carpenter wrote:
> > We had intended to only print dentry->d_name.len characters but there is
> > a width vs precision typo so if the name isn't NUL terminated it will
> > read past the end of the buffer.
> 
> OK, it took me quite some time to grasp what you mean here. The code
> works as expected because d_name.len and dname.name are in sync so there
> no spacing going to happen. Anyway what you propose is formally more
> correct I guess.
>  

Yeah.  If we are sure that the name has a NUL terminator then this
change has no effect.

regards,
dan carpenter

WARNING: multiple messages have this Message-ID
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm: debug: Fix a width vs precision bug in printk
Date: Fri, 23 Nov 2018 17:36:06 +0300	[thread overview]
Message-ID: <20181123143605.GB2970@unbuntlaptop> (raw)
In-Reply-To: <20181123090125.GC8625@dhcp22.suse.cz>

On Fri, Nov 23, 2018 at 10:01:25AM +0100, Michal Hocko wrote:
> On Fri 23-11-18 10:21:35, Dan Carpenter wrote:
> > We had intended to only print dentry->d_name.len characters but there is
> > a width vs precision typo so if the name isn't NUL terminated it will
> > read past the end of the buffer.
> 
> OK, it took me quite some time to grasp what you mean here. The code
> works as expected because d_name.len and dname.name are in sync so there
> no spacing going to happen. Anyway what you propose is formally more
> correct I guess.
>  

Yeah.  If we are sure that the name has a NUL terminator then this
change has no effect.

regards,
dan carpenter

  reply	other threads:[~2018-11-23 14:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23  7:21 Dan Carpenter
2018-11-23  7:21 ` Dan Carpenter
2018-11-23  7:47 ` Anshuman Khandual
2018-11-23  7:59   ` Anshuman Khandual
2018-11-23  9:01 ` Michal Hocko
2018-11-23  9:01   ` Michal Hocko
2018-11-23 14:36   ` Dan Carpenter [this message]
2018-11-23 14:36     ` Dan Carpenter
2018-11-23 14:48     ` Tetsuo Handa
2018-11-23 14:48       ` Tetsuo Handa
2018-11-24  0:08       ` Andrew Morton
2018-11-24  0:08         ` Andrew Morton
2018-11-25  8:08         ` Michal Hocko
2018-11-25  8:08           ` Michal Hocko
2018-11-23 10:37 ` David Hildenbrand
2018-11-23 10:37   ` David Hildenbrand

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=20181123143605.GB2970@unbuntlaptop \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=pasha.tatashin@oracle.com \
    --cc=willy@infradead.org \
    --subject='Re: [PATCH] mm: debug: Fix a width vs precision bug in printk' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.