From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbdLLRLO (ORCPT ); Tue, 12 Dec 2017 12:11:14 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33719 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbdLLRLL (ORCPT ); Tue, 12 Dec 2017 12:11:11 -0500 Date: Tue, 12 Dec 2017 18:11:09 +0100 (CET) From: Thomas Gleixner To: Eric Biggers cc: syzbot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Subject: Re: general protection fault in string In-Reply-To: <20171211230305.GA48753@gmail.com> Message-ID: References: <001a1143e6ccdb8581055f499952@google.com> <001a1143fb3e24a4e4055f689d15@google.com> <20171211230305.GA48753@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Dec 2017, Eric Biggers wrote: > On Sat, Dec 02, 2017 at 09:10:01PM -0800, syzbot wrote: > > ---[ end trace 3570c98033660e3f ]--- > > The bug is that sys_timer_create() allows setting ->it_sigev_notify to almost > any value, but show_timer() assumes that it has one of a specific set of values. > Here's a simplified reproducer: > > #include > #include > #include > #include > > int main() > { > struct sigevent e = { > .sigev_signo = 0x1c, > .sigev_notify = 0x100000, > }; > timer_t t; > int fd; > char buf[64]; > > timer_create(CLOCK_MONOTONIC, &e, &t); > > fd = open("/proc/self/timers", O_RDONLY); > > read(fd, buf, sizeof(buf)); > } > > I wonder if anything would break if we made sys_timer_create() return -EINVAL > for unrecognized values of sigev_notify? That's what it *should* do, but it > seems to be the classic "unchecked flags" bug, yet again... So this is the 5th time this comes up and I sent a patch the first time. No answer since than just more repeating reports. https://marc.info/?l=linux-kernel&m=151204669103208&w=2 Thanks, tglx