From: David Hildenbrand <david@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>
Cc: 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 11:37:55 +0100 [thread overview]
Message-ID: <831d66e9-7cf7-00a5-0a40-b7a7109dddbf@redhat.com> (raw)
In-Reply-To: <20181123072135.gqvblm2vdujbvfjs@kili.mountain>
On 23.11.18 08:21, 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.
>
> Fixes: 408ddbc22be3 ("mm: print more information about mapping in __dump_page")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> mm/debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/debug.c b/mm/debug.c
> index d18c5cea3320..faf856b652b6 100644
> --- a/mm/debug.c
> +++ b/mm/debug.c
> @@ -80,7 +80,7 @@ void __dump_page(struct page *page, const char *reason)
> if (mapping->host->i_dentry.first) {
> struct dentry *dentry;
> dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias);
> - pr_warn("name:\"%*s\" ", dentry->d_name.len, dentry->d_name.name);
> + pr_warn("name:\"%.*s\" ", dentry->d_name.len, dentry->d_name.name);
> }
> }
> BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2018-11-23 10:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 7:21 [PATCH] mm: debug: Fix a width vs precision bug in printk Dan Carpenter
2018-11-23 7:47 ` Anshuman Khandual
2018-11-23 9:01 ` Michal Hocko
2018-11-23 14:36 ` Dan Carpenter
2018-11-23 14:48 ` Tetsuo Handa
2018-11-24 0:08 ` Andrew Morton
2018-11-25 8:08 ` Michal Hocko
2018-11-23 10:37 ` David Hildenbrand [this message]
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=831d66e9-7cf7-00a5-0a40-b7a7109dddbf@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=pasha.tatashin@oracle.com \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).