From: Michal Hocko <mhocko@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Leon Yu <chianglungyu@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Kees Cook <keescook@chromium.org>,
John Stultz <john.stultz@linaro.org>,
Mateusz Guzik <mguzik@redhat.com>,
Janis Danisevskis <jdanis@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] proc: fix NULL dereference when reading /proc/<pid>/auxv
Date: Thu, 20 Oct 2016 21:21:24 +0200 [thread overview]
Message-ID: <20161020192124.GB27342@dhcp22.suse.cz> (raw)
In-Reply-To: <20161020170438.GA13724@redhat.com>
On Thu 20-10-16 19:04:39, Oleg Nesterov wrote:
> On 10/20, Leon Yu wrote:
> >
> > --- a/fs/proc/base.c
> > +++ b/fs/proc/base.c
> > @@ -1014,6 +1014,9 @@ static ssize_t auxv_read(struct file *file, char __user *buf,
> > {
> > struct mm_struct *mm = file->private_data;
> > unsigned int nwords = 0;
> > +
> > + if (!mm)
> > + return 0;
> > do {
> > nwords += 2;
> > } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
>
> Michal disagrees and I won't argue with his patch which makes __mem_open()
> fail if ->mm == NULL. Even if I don't really understand why should we change
> the old behaviour, this _can_ break or at least confuse something/someone.
>
> However, even if we do the change above, personally I do think we should
> fix the trivial bug first, then surprise the user-space.
I am not objecting to this particular patch as it is obviously correct.
I was just hoping to have a more generic solution. The issue was
introduced in this merge window so it is not like we would need as
minimalistic approach possible. If the __mem_open approach sounds too
dangerous I will not pursue it.
Anyway feel free to add
Acked-by: Michal Hocko <mhocko@suse.com>
for this patch.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2016-10-20 19:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 13:59 [PATCH] " Leon Yu
2016-10-19 14:13 ` Michal Hocko
2016-10-19 16:12 ` Oleg Nesterov
2016-10-19 16:17 ` Michal Hocko
2016-10-19 16:44 ` Oleg Nesterov
2016-10-19 17:00 ` Michal Hocko
2016-10-19 14:20 ` Al Viro
2016-10-19 14:51 ` Michal Hocko
2016-10-19 14:51 ` Leon Yu
2016-10-19 17:17 ` Michal Hocko
2016-10-20 12:32 ` Leon Yu
2016-10-20 12:44 ` Michal Hocko
2016-10-20 12:23 ` [PATCH v2] " Leon Yu
2016-10-20 17:04 ` Oleg Nesterov
2016-10-20 19:21 ` Michal Hocko [this message]
2016-10-21 12:47 ` Leon Yu
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=20161020192124.GB27342@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chianglungyu@gmail.com \
--cc=jdanis@google.com \
--cc=john.stultz@linaro.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mguzik@redhat.com \
--cc=oleg@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/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®