From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA463C4332F for ; Sun, 13 Mar 2022 00:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231803AbiCMApZ (ORCPT ); Sat, 12 Mar 2022 19:45:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiCMApY (ORCPT ); Sat, 12 Mar 2022 19:45:24 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F38FA11178; Sat, 12 Mar 2022 16:44:17 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTCL7-00ATUk-Fi; Sun, 13 Mar 2022 00:44:05 +0000 Date: Sun, 13 Mar 2022 00:44:05 +0000 From: Al Viro To: Tetsuo Handa Cc: Paul Moore , John Johansen , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Christian Brauner , "Darrick J . Wong" , Eric Paris , James Morris , Kentaro Takeda , Miklos Szeredi , "Serge E . Hallyn" , Stephen Smalley , Steve French , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , selinux@vger.kernel.org, Casey Schaufler Subject: Re: [PATCH v1] fs: Fix inconsistent f_mode Message-ID: References: <20220228215935.748017-1-mic@digikod.net> <20220301092232.wh7m3fxbe7hyxmcu@wittgenstein> <8d520529-4d3e-4874-f359-0ead9207cead@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: On Sat, Mar 12, 2022 at 10:34:27AM +0900, Tetsuo Handa wrote: > On 2022/03/12 7:15, Paul Moore wrote: > > The silence on this has been deafening :/ No thoughts on fixing, or > > not fixing OPEN_FMODE(), Al? > > On 2022/03/01 19:15, Mickaël Salaün wrote: > > > > On 01/03/2022 10:22, Christian Brauner wrote: > >> That specific part seems a bit risky at first glance. Given that the > >> patch referenced is from 2009 this means we've been allowing O_WRONLY | > >> O_RDWR to succeed for almost 13 years now. > > > > Yeah, it's an old bug, but we should keep in mind that a file descriptor > > created with such flags cannot be used to read nor write. However, > > unfortunately, it can be used for things like ioctl, fstat, chdir… I > > don't know if there is any user of this trick. > > I got a reply from Al at https://lkml.kernel.org/r/20090212032821.GD28946@ZenIV.linux.org.uk > that sys_open(path, 3) is for ioctls only. And I'm using this trick when opening something > for ioctls only. ... so it's not just fdutils. Cast in stone, IOW.