Re: general protection fault in put_pid

From: Dmitry Vyukov
Date: Thu Dec 20 2018 - 10:37:08 EST


On Wed, Dec 19, 2018 at 10:04 AM Manfred Spraul
<manfred@xxxxxxxxxxxxxxxx> wrote:
>
> Hello Dmitry,
>
> On 12/12/18 11:55 AM, Dmitry Vyukov wrote:
> > On Tue, Dec 11, 2018 at 9:23 PM syzbot
> > <syzbot+1145ec2e23165570c3ac@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >> Hello,
> >>
> >> syzbot found the following crash on:
> >>
> >> HEAD commit: f5d582777bcb Merge branch 'for-linus' of git://git.kernel...
> >> git tree: upstream
> >> console output: https://syzkaller.appspot.com/x/log.txt?x=135bc547400000
> >> kernel config: https://syzkaller.appspot.com/x/.config?x=c8970c89a0efbb23
> >> dashboard link: https://syzkaller.appspot.com/bug?extid=1145ec2e23165570c3ac
> >> compiler: gcc (GCC) 8.0.1 20180413 (experimental)
> >> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16803afb400000
> > +Manfred, this looks similar to the other few crashes related to
> > semget$private(0x0, 0x4000, 0x3f) that you looked at.
>
> I found one unexpected (incorrect?) locking, see the attached patch.
>
> But I doubt that this is the root cause of the crashes.


But why? These one-off sporadic crashes reported by syzbot looks
exactly like a subtle race and your patch touches sem_exit_ns involved
in all reports.
So if you don't spot anything else, I would say close these 3 reports
with this patch (I see you already included Reported-by tags which is
great!) and then wait for syzbot reaction. Since we got 3 of them, if
it's still not fixed I would expect that syzbot will be able to
retrigger this later again.


> Any remarks on the patch?
>
> I would continue to search, and then send a series with all findings.
>
> --
>
> Manfred
>