Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp880249ybt; Tue, 7 Jul 2020 02:32:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt3nXA9/cN8E6d4GHc4I8diGSgR49E39Th3IiDFU7Y4Mi+gcaq+QdyhkMnDKfVb1OP9CPz X-Received: by 2002:a17:906:7d90:: with SMTP id v16mr20775603ejo.27.1594114322847; Tue, 07 Jul 2020 02:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594114322; cv=none; d=google.com; s=arc-20160816; b=GMp3cePd2T0QWaJz4nVhdHrlAImZHgcxvwz2Y60xjoVblWcSwtKiu8AP1r/pZTvMYo t5dPgg5jpsGeAwcMVZpH3AJiJGTF+AEV8SvcMK9/tvT0MzuPXuksR3MW6moaCZhx5Dmp 24U8z/gQ4HRsBf9yFxfreSPJ/wKZqs/6gC2BF9uJwwRnU1WhjIDnFrlPAARzxIvzVH7Y yFFTCkxMo60Dh+tLEymr9RwUGS4QrhPmiXb+mZEE2GVmITXoAfdzjoNvbtCIPA6YPsdU Hv0BwITL8ov8LE74hEWcEvrVy3ioglP9B0ml6PYsEzOW95Cn+5hli+aQKvLME6DGFvcL ey+g== 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 :dkim-signature; bh=/30k20WRbHIFAMJuZFVmZG3SrCQjhSwstLMwlIkt+vU=; b=tzTAjVK79IxAtGZDcRdjBqIG9GyEMCMnnDTqGoEvAZG1LWyI/cg4DazMsRk0IMCrpj iQiK9i56J8/S0Q2Y4QHzqZOrPGseRj6Bsk5RN7u6/PVVh5uiEKQHlhROyAHLnEBjOUV1 QnCEv4WK1Mjb3MF2WPKTUdGbg13LIfd4lTpznszRoiCD15q5ITcT2lQgEIs0is0rr6rv Dwee4k+YEhyQg7G3bauYL0WBTtS2Br8AqA14lEoXQvlm7e6iwU1UslIM6JRlA9qGwNFQ RvcbDElaFkS9v1L4tOrFQfTJZvoJaiYM+KONGiwWbzJGcGsHhft0aMFdUwy+rEpqJqFK fRig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G5b57d5V; 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 ce9si15818735edb.70.2020.07.07.02.31.38; Tue, 07 Jul 2020 02:32:02 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=G5b57d5V; 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 S1726879AbgGGJbe (ORCPT + 99 others); Tue, 7 Jul 2020 05:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:57622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgGGJbd (ORCPT ); Tue, 7 Jul 2020 05:31:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47DBE2065F; Tue, 7 Jul 2020 09:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594114293; bh=7EJPV5cge5x3+J13JIKyNgux4EwJmANov4vu3RAeYAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G5b57d5VluIkuQJOC73on6FYdeC3Z9X1U3EH8Y6N35tSs1ybjw+w2UaJMRNvNiI0C Ztuon0HGC5mXaRIHbnMgXBEjgnZ8st6X1f0tTkpVWTVYNchlfy/EsoIrbhNasxpjrD b4O5dyY2lR6K9uqQZ+lUSMciMwebhkosO8EJSxJE= Date: Tue, 7 Jul 2020 11:31:31 +0200 From: Greg Kroah-Hartman To: Kees Cook Cc: James Morris , Luis Chamberlain , Mimi Zohar , Scott Branden , "Rafael J. Wysocki" , Alexander Viro , Jessica Yu , Dmitry Kasatkin , "Serge E. Hallyn" , Casey Schaufler , "Eric W. Biederman" , Peter Zijlstra , Matthew Garrett , David Howells , Mauro Carvalho Chehab , Randy Dunlap , "Joel Fernandes (Google)" , KP Singh , Dave Olsthoorn , Hans de Goede , Peter Jones , Andrew Morton , Stephen Boyd , Paul Moore , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 0/4] Fix misused kernel_read_file() enums Message-ID: <20200707093131.GA2592640@kroah.com> References: <20200707081926.3688096-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707081926.3688096-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 01:19:22AM -0700, Kees Cook wrote: > Hi, > > In looking for closely at the additions that got made to the > kernel_read_file() enums, I noticed that FIRMWARE_PREALLOC_BUFFER > and FIRMWARE_EFI_EMBEDDED were added, but they are not appropriate > *kinds* of files for the LSM to reason about. They are a "how" and > "where", respectively. Remove these improper aliases and refactor the > code to adapt to the changes. > > Additionally adds in missing calls to security_kernel_post_read_file() > in the platform firmware fallback path (to match the sysfs firmware > fallback path) and in module loading. I considered entirely removing > security_kernel_post_read_file() hook since it is technically unused, > but IMA probably wants to be able to measure EFI-stored firmware images, > so I wired it up and matched it for modules, in case anyone wants to > move the module signature checks out of the module core and into an LSM > to avoid the current layering violations. > > This touches several trees, and I suspect it would be best to go through > James's LSM tree. > > Thanks! > > -Kees > > Kees Cook (4): > firmware_loader: EFI firmware loader must handle pre-allocated buffer > fs: Remove FIRMWARE_PREALLOC_BUFFER from kernel_read_file() enums > fs: Remove FIRMWARE_EFI_EMBEDDED from kernel_read_file() enums > module: Add hook for security_kernel_post_read_file() Looks good to me, thanks for fixing this up: Reviewed-by: Greg Kroah-Hartman