From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: David Laight To: 'Alan Cox' , Salvatore Mesoraca CC: "linux-kernel@vger.kernel.org" , "Kernel Hardening" , "linux-fsdevel@vger.kernel.org" , "Alexander Viro" , Jann Horn , Kees Cook , Solar Designer , "Eric W. Biederman" Subject: RE: [PATCH v3 2/2] Protected O_CREAT open in sticky directories Date: Fri, 24 Nov 2017 10:53:11 +0000 Message-ID: <33dcc007e92349999ce77bf45825be22@AcuMS.aculab.com> References: <1511337706-8297-1-git-send-email-s.mesoraca16@gmail.com> <1511337706-8297-3-git-send-email-s.mesoraca16@gmail.com> <20171122165144.07aea7ac@alans-desktop> In-Reply-To: <20171122165144.07aea7ac@alans-desktop> Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Alan Cox > Sent: 22 November 2017 16:52 > > On Wed, 22 Nov 2017 09:01:46 +0100 > Salvatore Mesoraca wrote: > > > Disallows O_CREAT open missing the O_EXCL flag, in world or > > group writable directories, even if the file doesn't exist yet. > > With few exceptions (e.g. shared lock files based on flock()) > > Enough exceptions to make it a bad idea. > > Firstly if you care this much *stop* having shared writable directories. > We have namespaces, you don't need them. You can give every user their > own /tmp etc. Looks like a very bad idea to me as well. Doesn't this stop all shell redirects into a shared /tmp ? I'm pretty sure most programs use O_CREAT | O_TRUNC for output files - they'll all stop working. If there are some directories where you need to force O_EXCL you need to make it a property of the directory, not the kernel. David