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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA7F6C47420 for ; Tue, 29 Sep 2020 18:00:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EF37206F7 for ; Tue, 29 Sep 2020 18:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727841AbgI2SAl (ORCPT ); Tue, 29 Sep 2020 14:00:41 -0400 Received: from verein.lst.de ([213.95.11.211]:41188 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgI2SAl (ORCPT ); Tue, 29 Sep 2020 14:00:41 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E781267373; Tue, 29 Sep 2020 20:00:37 +0200 (CEST) Date: Tue, 29 Sep 2020 20:00:37 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Ondrej Mosnacek , Ian Kent , Stephen Smalley , Al Viro , Christoph Hellwig , autofs@vger.kernel.org, Linux Security Module list , SElinux list , Zdenek Pytela Subject: Re: Commit 13c164b1a186 - regression for LSMs/SELinux? Message-ID: <20200929180037.GA12447@lst.de> References: <20200921163011.GZ3421308@ZenIV.linux.org.uk> <0764629d33d151aee743d0429ac87a5b0c300235.camel@themaw.net> <05c18390d485ae6d84c49f707d20b49e28f210a6.camel@themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: On Tue, Sep 29, 2020 at 10:23:50AM -0700, Linus Torvalds wrote: > On Tue, Sep 29, 2020 at 5:16 AM Ondrej Mosnacek wrote: > > > > OK, so it seems that reverting comes out as the best choice here. > > Yeah. > > > BTW, I'm looking at rw_verify_area() and I see this "If (ppos)" check > > and the comment above it... And then I look at autofs_write(), which > > passes &file->f_pos, while ksys_write() passes file_ppos(file) > > Ok, that doesn't matter for the security_file_permission() issue, but > yes, autofs is doing the traditional thing, and it's pointless. Using > file_ppos(file) isn't an option since it's an inline to read_write.c, > but it could just pass in NULL these days and avoid that too. > > So how about we just do the appended patch? Can whoever sees this > problem just verify, even though it looks trivially correct... This looks sensible to me. I'd throw in a /* only for autofs, don't use in new code */ near the export, but users of these kind of functions tend to be blind copy and paste code anyway, so the comment probably isn't even read by the relevant parties..