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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3A02FC61DD8 for ; Mon, 16 Nov 2020 18:09:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0847F2227F for ; Mon, 16 Nov 2020 18:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730576AbgKPSJS (ORCPT ); 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 ;-/