From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208AbdLNOet (ORCPT ); Thu, 14 Dec 2017 09:34:49 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:41645 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbdLNOeq (ORCPT ); Thu, 14 Dec 2017 09:34:46 -0500 X-Google-Smtp-Source: ACJfBouKCCLadiYZsi5hORe3mMIJPLq0IGsRKPlezVR5qPZmWnXbQLD3jF9r58g/CusB7upYPxJxtq078U/zZLrnx/s= MIME-Version: 1.0 In-Reply-To: References: <94eb2c18a77ce8d832055f2cf263@google.com> <20171212083343.GG22935@kroah.com> From: Dmitry Vyukov Date: Thu, 14 Dec 2017 15:34:24 +0100 Message-ID: Subject: Re: general protection fault in show_timer To: Thomas Gleixner Cc: Greg KH , Kees Cook , Alexey Dobriyan , security@kernel.org, Akinobu Mita , Andrew Morton , "Eric W. Biederman" , Josh Poimboeuf , LKML , Ingo Molnar , syzkaller-bugs@googlegroups.com, Vegard Nossum Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 14, 2017 at 3:26 PM, Thomas Gleixner wrote: > On Tue, 12 Dec 2017, Greg KH wrote: > >> On Tue, Dec 05, 2017 at 11:58:07AM -0800, Kees Cook wrote: >> > On Thu, Nov 30, 2017 at 4:57 AM, Thomas Gleixner wrote: >> > > On Thu, 30 Nov 2017, Alexey Dobriyan wrote: >> > > >> > >> [cc security@] >> > >> 100% oops with interrupts disabled by nobody >> > >> or kernel memory read >> > >> [nods] >> > >> you named the bug already >> > >> >> > >> "notify" directly comes from userspace struct sigevent::sigev_notify >> > >> without adult supervision. >> > >> >> > >> Reproducer is timer_create + read(/proc/self/timers) >> > > >> > > Bah. That's a really old one. >> > > >> > > Tentative fix below. That needs more though but looking at the existing >> > > check there is only one valid combo with SIGEV_THREAD_ID. >> > > >> > > Thanks, >> > > >> > > tglx >> > > >> > > 8<---------------- >> > > --- a/kernel/time/posix-timers.c >> > > +++ b/kernel/time/posix-timers.c >> > > @@ -434,6 +434,16 @@ static struct pid *good_sigevent(sigeven >> > > { >> > > struct task_struct *rtn = current->group_leader; >> > > >> > > + switch (event->sigev_notify) { >> > > + case SIGEV_NONE: >> > > + case SIGEV_SIGNAL: >> > > + case SIGEV_SIGNAL | SIGEV_THREAD_ID: >> > > + case SIGEV_THREAD: >> > > + break; >> > > + default: >> > > + return NULL; >> > > + } >> > > + >> > > if ((event->sigev_notify & SIGEV_THREAD_ID ) && >> > > (!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) || >> > > !same_thread_group(rtn, current) || >> > >> > FWIW, this looks correct to me. >> >> Did this ever go anywhere? I don't see it in Linus's tree yet... > > I learned yesterday that syzboz is understuffed and cannot test patches, so > I need to find a minute to run the reproducer myself and verify that the > patch is correct. Hi Thomas, Why do you say so? Have you tried to ask it to test? https://github.com/google/syzkaller/blob/master/docs/syzbot.md#communication-with-syzbot What happened?