From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by kanga.kvack.org (Postfix) with ESMTP id 0F4126B0033 for ; Tue, 7 Feb 2017 15:18:52 -0500 (EST) Received: by mail-it0-f69.google.com with SMTP id y196so123600830ity.1 for ; Tue, 07 Feb 2017 12:18:52 -0800 (PST) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com. [2607:f8b0:4001:c06::22e]) by mx.google.com with ESMTPS id i21si222083itb.101.2017.02.07.12.18.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 12:18:51 -0800 (PST) Received: by mail-io0-x22e.google.com with SMTP id j13so99391449iod.3 for ; Tue, 07 Feb 2017 12:18:51 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20160114212201.GA28910@www.outflux.net> <20160525214935.GI14480@ZenIV.linux.org.uk> From: Kees Cook Date: Tue, 7 Feb 2017 12:18:50 -0800 Message-ID: Subject: Re: [PATCH v9] fs: clear file privilege bits when mmap writing Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Al Viro , Andrew Morton , Konstantin Khlebnikov , Jan Kara , yalin wang , Willy Tarreau , "linux-mm@kvack.org" , Linux Kernel Mailing List On Fri, Jan 27, 2017 at 7:47 PM, Andy Lutomirski wrote: > On Wed, May 25, 2016 at 2:49 PM, Al Viro wrote: >> On Wed, May 25, 2016 at 02:36:57PM -0700, Kees Cook wrote: >> >>> Hm, this didn't end up getting picked up. (This jumped out at me again >>> because i_mutex just vanished...) >>> >>> Al, what's the right way to update the locking in this patch? >> >> ->i_mutex is dealt with just by using lock_inode(inode)/unlock_inode(inode); >> I hadn't looked at the rest of the locking in there. > > Ping? > > If this is too messy, I'm wondering if we could get away with a much > simpler approach: clear the suid and sgid bits when the file is opened > for write. I think that'll break something, but I don't have any actual examples. Regardless, I'd still like to see this hole fixed... -Kees -- Kees Cook Pixel Security -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org