From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161703AbbKTBDa (ORCPT ); Thu, 19 Nov 2015 20:03:30 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:22073 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759429AbbKTBD2 (ORCPT ); Thu, 19 Nov 2015 20:03:28 -0500 Date: Fri, 20 Nov 2015 02:03:11 +0100 From: Willy Tarreau To: Kees Cook Cc: linux-kernel@vger.kernel.org, Andrew Morton , Dave Chinner , Andy Lutomirski , Jan Kara , "Kirill A. Shutemov" , Mel Gorman , Johannes Weiner , Rik van Riel , Matthew Wilcox , Shachar Raindel , Boaz Harrosh , Michal Hocko , Haggai Eran , Theodore Tso , Dirk Steinmetz , Michael Kerrisk-manpages , Serge Hallyn , Seth Forshee , Alexander Viro , Linux FS Devel , "Eric W . Biederman" , Serge Hallyn , linux-mm@kvack.org Subject: Re: [PATCH] fs: clear file set[ug]id when writing via mmap Message-ID: <20151120010311.GA31728@1wt.eu> References: <20151120001043.GA28204@www.outflux.net> <20151120010016.GB31694@1wt.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151120010016.GB31694@1wt.eu> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2015 at 02:00:16AM +0100, Willy Tarreau wrote: > > diff --git a/mm/memory.c b/mm/memory.c > > index deb679c31f2a..4c970a4e0057 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -2036,6 +2036,7 @@ static inline int wp_page_reuse(struct mm_struct *mm, > > > > if (!page_mkwrite) > > file_update_time(vma->vm_file); > > + file_remove_privs(vma->vm_file); > > I thought you said in one of the early mails of this thread that it > didn't work. Or maybe I misunderstood. OK never mind for this one I just saw the other mail where you said the test is OK now. But I'm still worried about the performance so the other point below remains : > Also, don't you think we should move that into the if (!page_mkwrite) > just like for the time update ? Thanks! Willy