From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:45783 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbcAFUZU (ORCPT ); Wed, 6 Jan 2016 15:25:20 -0500 Date: Wed, 6 Jan 2016 20:25:17 +0000 From: Al Viro To: Linus Torvalds Cc: Jann Horn , linux-fsdevel , Kees Cook , Andy Lutomirski , security@kernel.org Subject: Re: [PATCH 1/2] compat_ioctl: don't look up the fd twice Message-ID: <20160106202517.GA18143@ZenIV.linux.org.uk> References: <1452014850-19354-1-git-send-email-jann@thejh.net> <20160106145008.GU9938@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160106145008.GU9938@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jan 06, 2016 at 02:50:08PM +0000, Al Viro wrote: > On Tue, Jan 05, 2016 at 11:33:53AM -0800, Linus Torvalds wrote: > > On Jan 5, 2016 9:27 AM, "Jann Horn" wrote: > > > > > > This change mitigates potential security issues by > > > preventing a race that permits invocation of > > > unlocked_ioctl handlers under KERNEL_DS through compat > > > code even if a corresponding compat_ioctl handler exists. > > > > Yeah, these two patches are much more legible now. Thanks. > > > > Acked-by: Linus Torvalds > > > > Al, I'm assuming I'll get these through the vfs tree during the 4.5 merge > > window. Correct? > > I'll need to finish reviewing, but yes, that's 4.5 vfs.git fodder. > So far it looks sane... Said that, I'm not sure it's the best approach. E.g. I2C_* stuff is defined only in one driver and if we are touching that code at all, we might as well take it out of fs/compat_ioctl.c and be done with that - just add ->compat_ioctl() to drivers/i2c/i2c-dev.c and move that crap over there (and to hell with compat_alloc_user_space(), while we are at it). Oh, well - that can be done in followups, anyway. Applied, with s/filp/file/ through the entire thing - I really don't like that naming convention. BTW, am I right assuming that it had been adopted from OS Design and Implementation way back when?