Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3279146pxb; Mon, 16 Nov 2020 10:11:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbeXnWH5YAEg7THFrTRISslpRTPIOwYeZJw7pHur+jC0xhypbKxNq5wDL3laSU1K43jgQD X-Received: by 2002:a05:6402:1358:: with SMTP id y24mr6410519edw.291.1605550267512; Mon, 16 Nov 2020 10:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605550267; cv=none; d=google.com; s=arc-20160816; b=rYg0jGfFbxMK69R5vYGvIe9T+edo2NSlRqu3qfhVLQqFPch/c0aPCuEstmZwLmPbkB mbwGgxXASmb0wYXfRN01ks6NZmoAeTzClZbr0b7DFwyGG+fKWFGV1eRda8VsZmeMAuca 8xLWkx/ux48aSsNYZP1RgAZrUJ04yezfhD92E/8GNT2D7jSMK20l7lmdx4ij23lgO3DL sOr3I26KgoSZZKc/FbJHRcShjXhd/gF0mNDZse6JYuqlSuLhZk8miG5rYYYYXUa7SP0v 7aRWbzW2ryq6vV3MSDYiFVoFJ2pdIXPzJvLoa2P+WbjUSLT8RY0S8Im8/kgdEvxq50st CGDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=sL01TGE/Gd14R6osoRZBf/8dSvHwRCJfoVxazpE6PrI=; b=luUNihCazR/eSi9UXFnilEVxN+CFjtw09/dtRahZnV5ITi2kcMF2pQcWgUjQlnISGG zTZzLB7pisxknf/gdFKXxrVCHBGnLXmQfanYfgt1jiI0kGxEL7NS6YP8xOIcDeyesb8b UFanWJhB00cdu9dSCeJHyVTkg/p5pgIPTew6fqyGfg8Nb/gpcazE959T8TX9zhrwY4wL SnVBhm8MH2AX/mcuwgqyXpSEKUh5RdrOBCDDT+1ryNpg3Aspy/7r73Ppn4bvficeyBOv yKw2vghGZfP61QmnTGLzYGPM6K66+wGTIu4hAmKeUfY+czxtPiGcoz9n7mXCSRhPcvLG IJ3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw3si13338891edb.149.2020.11.16.10.10.43; Mon, 16 Nov 2020 10:11:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730503AbgKPSJS (ORCPT + 99 others); Mon, 16 Nov 2020 13:09:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728442AbgKPSJR (ORCPT ); Mon, 16 Nov 2020 13:09:17 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B73C0613CF; Mon, 16 Nov 2020 10:09:16 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1keivv-007Qye-IV; Mon, 16 Nov 2020 18:08:55 +0000 Date: Mon, 16 Nov 2020 18:08:55 +0000 From: Al Viro To: Linus Torvalds Cc: Mimi Zohar , Christoph Hellwig , Roberto Sassu , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Silviu Vlasceanu , "stable@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" Subject: Re: [RESEND][PATCH] ima: Set and clear FMODE_CAN_READ in ima_calc_file_hash() Message-ID: <20201116180855.GX3576660@ZenIV.linux.org.uk> References: <20201113080132.16591-1-roberto.sassu@huawei.com> <20201114111057.GA16415@infradead.org> <0fd0fb3360194d909ba48f13220f9302@huawei.com> <20201116162202.GA15010@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 09:37:32AM -0800, Linus Torvalds wrote: > On Mon, Nov 16, 2020 at 8:47 AM Mimi Zohar wrote: > > > > This discussion seems to be going down the path of requiring an IMA > > filesystem hook for reading the file, again. That solution was > > rejected, not by me. What is new this time? > > You can't read a non-read-opened file. Not even IMA can. > > So don't do that then. > > IMA is doing something wrong. Why would you ever read a file that can't be read? > > Fix whatever "open" function instead of trying to work around the fact > that you opened it wrong. IMA pulls that crap on _every_ open(2), including O_WRONLY. As far as I'm concerned, the only sane answer is not enabling that thing on your builds; they are deeply special and I hadn't been able to reason with them no matter how much I tried ;-/