mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	security@kernel.org, Akinobu Mita <akinobu.mita@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	syzkaller-bugs@googlegroups.com,
	Vegard Nossum <vegard.nossum@oracle.com>
Subject: Re: general protection fault in show_timer
Date: Thu, 30 Nov 2017 13:57:55 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1711301355450.1925@nanos> (raw)
In-Reply-To: <CACVxJT9Q+-1xGkVmdz+e6869Few90E+D8fMQWeSpW=MA76_03A@mail.gmail.com>

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) ||

  parent reply	other threads:[~2017-11-30 12:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <94eb2c18a77ce8d832055f2cf263@google.com>
2017-11-30 11:08 ` Alexey Dobriyan
2017-11-30 11:31   ` Dmitry Vyukov
2017-11-30 11:38     ` Dmitry Vyukov
2017-11-30 12:20       ` Alexey Dobriyan
2017-11-30 12:57         ` Dmitry Vyukov
2017-11-30 12:57         ` Thomas Gleixner [this message]
2017-12-05 19:58           ` Kees Cook
2017-12-12  8:33             ` Greg KH
2017-12-14 14:26               ` Thomas Gleixner
2017-12-14 14:34                 ` Dmitry Vyukov
2017-12-14 15:34                   ` Thomas Gleixner
2017-12-14 18:36                     ` Eric Biggers
2017-12-15 16:40                       ` Thomas Gleixner
2017-12-19  1:01                         ` Eric Biggers
2017-12-04  3:17 ` syzbot
2017-12-04 12:11   ` Thomas Gleixner

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=alpine.DEB.2.20.1711301355450.1925@nanos \
    --to=tglx@linutronix.de \
    --cc=adobriyan@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=ebiederm@xmission.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=security@kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vegard.nossum@oracle.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

all inboxes | Powered by JetHome®