Re: [TEST PATCH] pid: fix allocating pid 2 for init (was Re: proc_flush_task oops)

2017-12-23 Thread Eric W. Biederman
Alexey Dobriyan writes: > On Fri, Dec 22, 2017 at 08:41:54AM -0600, Eric W. Biederman wrote: >> Alexey Dobriyan writes: > >> > unshare >> > fork >> > alloc_pid in level 1 succeeds >> > alloc_pid in level 0 fails, ->idr_next is 2 >> > fork >> >

[TEST PATCH] pid: fix allocating pid 2 for init (was Re: proc_flush_task oops)

2017-12-22 Thread Alexey Dobriyan
On Fri, Dec 22, 2017 at 08:41:54AM -0600, Eric W. Biederman wrote: > Alexey Dobriyan writes: > > unshare > > fork > > alloc_pid in level 1 succeeds > > alloc_pid in level 0 fails, ->idr_next is 2 > > fork > > alloc pid 2 > > exit > > > > Reliable reproducer and

Re: proc_flush_task oops

2017-12-22 Thread Eric W. Biederman
Alexey Dobriyan writes: > On 12/22/17, Eric W. Biederman wrote: >> Dave Jones writes: >> >>> On Thu, Dec 21, 2017 at 07:31:26PM -0600, Eric W. Biederman wrote: >>> > Dave Jones writes: >>> > >>> >

Re: proc_flush_task oops

2017-12-22 Thread Alexey Dobriyan
On 12/22/17, Eric W. Biederman wrote: > Dave Jones writes: > >> On Thu, Dec 21, 2017 at 07:31:26PM -0600, Eric W. Biederman wrote: >> > Dave Jones writes: >> > >> > > On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey

Re: proc_flush_task oops

2017-12-21 Thread Eric W. Biederman
Dave Jones writes: > On Thu, Dec 21, 2017 at 07:31:26PM -0600, Eric W. Biederman wrote: > > Dave Jones writes: > > > > > On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > > > > > > > > with proc_mnt still set to NULL is

Re: proc_flush_task oops

2017-12-21 Thread Dave Jones
On Thu, Dec 21, 2017 at 07:31:26PM -0600, Eric W. Biederman wrote: > Dave Jones writes: > > > On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > > > > > > with proc_mnt still set to NULL is a mystery to me. > > > > > > > > Is there any chance

Re: proc_flush_task oops

2017-12-21 Thread Eric W. Biederman
Dave Jones writes: > On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > > > > with proc_mnt still set to NULL is a mystery to me. > > > > > > Is there any chance the idr code doesn't always return the lowest valid > > > free number? So init gets

Re: proc_flush_task oops

2017-12-21 Thread Dave Jones
On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > > with proc_mnt still set to NULL is a mystery to me. > > > > Is there any chance the idr code doesn't always return the lowest valid > > free number? So init gets assigned something other than 1? > > Well, this theory is

Re: proc_flush_task oops

2017-12-21 Thread Eric W. Biederman
Dave Jones writes: > On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > > On 12/21/17, Eric W. Biederman wrote: > > > I have stared at this code, and written some test programs and I can't > > > see what is going on. alloc_pid

Re: proc_flush_task oops

2017-12-21 Thread Dave Jones
On Thu, Dec 21, 2017 at 12:38:12PM +0200, Alexey Dobriyan wrote: > On 12/21/17, Eric W. Biederman wrote: > > I have stared at this code, and written some test programs and I can't > > see what is going on. alloc_pid by design and in implementation (as far > > as I can

Re: proc_flush_task oops

2017-12-21 Thread Alexey Dobriyan
On 12/21/17, Eric W. Biederman wrote: > I have stared at this code, and written some test programs and I can't > see what is going on. alloc_pid by design and in implementation (as far > as I can see) is always single threaded when allocating the first pid > in a pid

Re: proc_flush_task oops

2017-12-21 Thread Eric W. Biederman
Dave Jones writes: > On Wed, Dec 20, 2017 at 12:25:52PM -0600, Eric W. Biederman wrote: >> > > > > > > If the warning triggers it means the bug is in alloc_pid and somehow > > > > something has gotten past the is_child_reaper check. > > > > > > You're onto

Re: proc_flush_task oops

2017-12-20 Thread Dave Jones
On Wed, Dec 20, 2017 at 12:25:52PM -0600, Eric W. Biederman wrote: > > > > > > If the warning triggers it means the bug is in alloc_pid and somehow > > > something has gotten past the is_child_reaper check. > > > > You're onto something. > > > I am not seeing where things go wrong, but

Re: proc_flush_task oops

2017-12-20 Thread Eric W. Biederman
Dave Jones writes: > On Tue, Dec 19, 2017 at 07:54:24PM -0600, Eric W. Biederman wrote: > > > > *Scratches my head* I am not seeing anything obvious. > > > > Can you try this patch as you reproduce this issue? > > > > diff --git a/kernel/pid.c b/kernel/pid.c > >

Re: proc_flush_task oops

2017-12-20 Thread Dmitry Vyukov
On Wed, Dec 20, 2017 at 2:54 AM, Eric W. Biederman wrote: > ebied...@xmission.com (Eric W. Biederman) writes: > >> Dave Jones writes: >> >>> On Tue, Dec 19, 2017 at 12:27:30PM -0600, Eric W. Biederman wrote: >>> > Dave Jones

Re: proc_flush_task oops

2017-12-19 Thread Dave Jones
On Tue, Dec 19, 2017 at 07:54:24PM -0600, Eric W. Biederman wrote: > > *Scratches my head* I am not seeing anything obvious. > > Can you try this patch as you reproduce this issue? > > diff --git a/kernel/pid.c b/kernel/pid.c > index b13b624e2c49..df9e5d4d8f83 100644 > ---

Re: proc_flush_task oops

2017-12-19 Thread Eric W. Biederman
ebied...@xmission.com (Eric W. Biederman) writes: > Dave Jones writes: > >> On Tue, Dec 19, 2017 at 12:27:30PM -0600, Eric W. Biederman wrote: >> > Dave Jones writes: >> > >> > > On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds

Re: proc_flush_task oops

2017-12-19 Thread Eric W. Biederman
Dave Jones writes: > On Tue, Dec 19, 2017 at 12:27:30PM -0600, Eric W. Biederman wrote: > > Dave Jones writes: > > > > > On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > > > > > > > But I don't see what would have changed

Re: proc_flush_task oops

2017-12-19 Thread Dave Jones
On Tue, Dec 19, 2017 at 12:27:30PM -0600, Eric W. Biederman wrote: > Dave Jones writes: > > > On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > > > > > But I don't see what would have changed in this area recently. > > > > > > Do you end up

Re: proc_flush_task oops

2017-12-19 Thread Eric W. Biederman
Dave Jones writes: > On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > > > But I don't see what would have changed in this area recently. > > > > Do you end up saving the seeds that cause crashes? Is this > > reproducible? (Other than seeing it

Re: proc_flush_task oops

2017-12-19 Thread Eric W. Biederman
Tetsuo Handa writes: > On 2017/12/19 12:39, Dave Jones wrote: >> On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: >> >> > But I don't see what would have changed in this area recently. >> > >> > Do you end up saving the seeds that cause

Re: proc_flush_task oops

2017-12-19 Thread Tetsuo Handa
On 2017/12/19 12:39, Dave Jones wrote: > On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > > > But I don't see what would have changed in this area recently. > > > > Do you end up saving the seeds that cause crashes? Is this > > reproducible? (Other than seeing it twoce, of

Re: proc_flush_task oops

2017-12-18 Thread Dave Jones
On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > But I don't see what would have changed in this area recently. > > Do you end up saving the seeds that cause crashes? Is this > reproducible? (Other than seeing it twoce, of course) Only clue so far, is every time I'm able to

Re: proc_flush_task oops

2017-12-18 Thread Dave Jones
On Mon, Dec 18, 2017 at 03:50:52PM -0800, Linus Torvalds wrote: > On Mon, Dec 18, 2017 at 3:10 PM, Dave Jones wrote: > > On Mon, Dec 18, 2017 at 10:15:41PM +, Al Viro wrote: > > > On Mon, Dec 18, 2017 at 04:44:38PM -0500, Dave Jones wrote: > > > > I've hit this

Re: proc_flush_task oops

2017-12-18 Thread Linus Torvalds
On Mon, Dec 18, 2017 at 3:10 PM, Dave Jones wrote: > On Mon, Dec 18, 2017 at 10:15:41PM +, Al Viro wrote: > > On Mon, Dec 18, 2017 at 04:44:38PM -0500, Dave Jones wrote: > > > I've hit this twice today. It's odd, because afaics, none of this code > > > has really

Re: proc_flush_task oops

2017-12-18 Thread Dave Jones
On Mon, Dec 18, 2017 at 10:15:41PM +, Al Viro wrote: > On Mon, Dec 18, 2017 at 04:44:38PM -0500, Dave Jones wrote: > > I've hit this twice today. It's odd, because afaics, none of this code > > has really changed in a long time. > > Which tree had that been? Linus, rc4. Dave

Re: proc_flush_task oops

2017-12-18 Thread Al Viro
On Mon, Dec 18, 2017 at 04:44:38PM -0500, Dave Jones wrote: > I've hit this twice today. It's odd, because afaics, none of this code > has really changed in a long time. Which tree had that been?

proc_flush_task oops

2017-12-18 Thread Dave Jones
I've hit this twice today. It's odd, because afaics, none of this code has really changed in a long time. Dave Oops: [#1] SMP CPU: 2 PID: 6743 Comm: trinity-c117 Not tainted 4.15.0-rc4-think+ #2 RIP: 0010:proc_flush_task+0x8e/0x1b0 RSP: 0018:c9000bbffc40 EFLAGS: 00010286 RAX: