From: Rik van Riel <riel@surriel.com>
To: Al Viro <viro@ZenIV.linux.org.uk>, Gargi Sharma <gs051095@gmail.com>
Cc: linux-kernel@vger.kernel.org, julia.lawall@lip6.fr,
akpm@linux-foundation.org, mingo@kernel.org,
pasha.tatashin@oracle.com, ktkhai@virtuozzo.com, oleg@redhat.com,
wangkefeng.wang@park.jinmi.com
Subject: Re: [RFC 1/2] proc: Return if nothing to unmount
Date: Sun, 10 Sep 2017 20:58:00 -0400 [thread overview]
Message-ID: <1505091480.21121.32.camel@surriel.com> (raw)
In-Reply-To: <20170909183135.GB5426@ZenIV.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]
On Sat, 2017-09-09 at 19:31 +0100, Al Viro wrote:
> On Sat, Sep 09, 2017 at 06:03:16PM +0530, Gargi Sharma wrote:
> > If a task exits before procfs is mounted, proc_flush_task_mnt will
> > be called with a NULL mnt parameter. In that case, not only is
> > there
> > nothing to unhash, but trying to do so will oops the kernel with a
> > null pointer dereference.
>
> You are misreading that sucker. It's about userland mounts, it's
> about
> the internal ones in pidns, for each pidns the process belongs to.
>
> IOW, what you are adding is dead code. The very first alloc_pid() in
> that pidns should've called pid_ns_prepare_proc(), which creates that
> vfsmount.
Looking at the code (now that I am home, and no longer
reading this email on my phone), I see the cause of this
problem.
A previous version of Gargi's code had RESERVED_PIDS as
the lower bound for idr_alloc_cyclic, even on the very
first PID allocation cycle in a PID namespace.
With the code changed to have 1 as the lower bound during
the first allocation cycle, pid_ns_prepare_proc() should
be called correctly, and things should work as expected.
Gargi, can you drop this patch 1/2, and make sure the code
still works fine?
--
All Rights Reversed.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2017-09-11 0:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-09 12:33 [RFC 0/2] Replace PID implementation with IDR API Gargi Sharma
2017-09-09 12:33 ` [RFC 1/2] proc: Return if nothing to unmount Gargi Sharma
2017-09-09 18:31 ` Al Viro
2017-09-10 19:41 ` Rik van Riel
2017-09-11 0:58 ` Rik van Riel [this message]
2017-09-09 12:33 ` [RFC 2/2] pid: Replace PID bitmap implementation with IDR API Gargi Sharma
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=1505091480.21121.32.camel@surriel.com \
--to=riel@surriel.com \
--cc=akpm@linux-foundation.org \
--cc=gs051095@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=pasha.tatashin@oracle.com \
--cc=viro@ZenIV.linux.org.uk \
--cc=wangkefeng.wang@park.jinmi.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