From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:60409 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212AbcBTUur (ORCPT ); Sat, 20 Feb 2016 15:50:47 -0500 Date: Sat, 20 Feb 2016 20:50:45 +0000 From: Al Viro To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Dmitry Vyukov , "linux-fsdevel@vger.kernel.org" , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin Subject: Re: fs: NULL deref in atime_needs_update Message-ID: <20160220205044.GJ17997@ZenIV.linux.org.uk> References: <56C3B35E.6020109@digikod.net> <20160220032127.GA19926@ZenIV.linux.org.uk> <20160220035442.GE17997@ZenIV.linux.org.uk> <56C86954.6030101@digikod.net> <20160220171044.GH17997@ZenIV.linux.org.uk> <56C8CBF4.9020207@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56C8CBF4.9020207@digikod.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Feb 20, 2016 at 09:26:28PM +0100, Micka�l Sala�n wrote: > > + if (unlikely(error > 0)) { > > + WARN_ON(1); > > + error = -EINVAL; > > + } > > if (got_write) > > mnt_drop_write(nd->path.mnt); > > path_put(&save_parent); > > > > I think your warning patch should be upstreamed to detect such cases :) I'm not sure whether it's better done there or one step closer to the source - e.g. telling whether it was bogus ->open() or a bogus LSM hook (and _which_ bogus LSM hook had it been) would be hard with that location of test. It still leaves the question of what's going on in Dmitry's tests - it might be one of those source or it might be something else entirely; this location of test would at least tell whether a stack underrun is involved or not... From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759412AbcBTUuu (ORCPT ); Sat, 20 Feb 2016 15:50:50 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:60409 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212AbcBTUur (ORCPT ); Sat, 20 Feb 2016 15:50:47 -0500 Date: Sat, 20 Feb 2016 20:50:45 +0000 From: Al Viro To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Dmitry Vyukov , "linux-fsdevel@vger.kernel.org" , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin Subject: Re: fs: NULL deref in atime_needs_update Message-ID: <20160220205044.GJ17997@ZenIV.linux.org.uk> References: <56C3B35E.6020109@digikod.net> <20160220032127.GA19926@ZenIV.linux.org.uk> <20160220035442.GE17997@ZenIV.linux.org.uk> <56C86954.6030101@digikod.net> <20160220171044.GH17997@ZenIV.linux.org.uk> <56C8CBF4.9020207@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56C8CBF4.9020207@digikod.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 20, 2016 at 09:26:28PM +0100, Mickaël Salaün wrote: > > + if (unlikely(error > 0)) { > > + WARN_ON(1); > > + error = -EINVAL; > > + } > > if (got_write) > > mnt_drop_write(nd->path.mnt); > > path_put(&save_parent); > > > > I think your warning patch should be upstreamed to detect such cases :) I'm not sure whether it's better done there or one step closer to the source - e.g. telling whether it was bogus ->open() or a bogus LSM hook (and _which_ bogus LSM hook had it been) would be hard with that location of test. It still leaves the question of what's going on in Dmitry's tests - it might be one of those source or it might be something else entirely; this location of test would at least tell whether a stack underrun is involved or not...