From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f177.google.com ([209.85.214.177]:34470 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbcAHAay (ORCPT ); Thu, 7 Jan 2016 19:30:54 -0500 Received: by mail-ob0-f177.google.com with SMTP id wp13so206274534obc.1 for ; Thu, 07 Jan 2016 16:30:53 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20151210223314.GA14512@www.outflux.net> References: <20151210223314.GA14512@www.outflux.net> From: Andy Lutomirski Date: Thu, 7 Jan 2016 16:30:33 -0800 Message-ID: Subject: Re: [PATCH v5] fs: clear file privilege bits when mmap writing To: Kees Cook Cc: Alexander Viro , Jan Kara , yalin wang , Willy Tarreau , Andrew Morton , Linux FS Devel , linux-arch , Linux API Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 10, 2015 at 2:33 PM, Kees Cook wrote: > Instead, detect the need to clear the bits during the page fault, and > actually remove the bits during final fput. Since the file was open for > writing, it wouldn't have been possible to execute it yet. This is cute but mysterious. Could you add a comment? > > + /* > + * XXX: While avoiding mmap_sem, we've already been written to. > + * We must ignore the return value, since we can't reject the > + * write. > + */ e.g. here?