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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 99F18C433DF for ; Tue, 7 Jul 2020 09:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AA5D206CD for ; Tue, 7 Jul 2020 09:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594114298; bh=7EJPV5cge5x3+J13JIKyNgux4EwJmANov4vu3RAeYAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=i6tacAkefSs8e1KE7ojoOmjRUqMX4nIg8+LY/1tLZQdKp3C+rEaQA8lY59Am4ua77 mjiOxUDcJI8anVmw6KTlMTz6lEmjaC2SiH9snO9qlrCs+ZypWexgnHABbJekhDgbzT PnTq9mXvodbNU0UPdkXUlkXPhvY9hQ0Hz7hrWMTg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgGGJbe (ORCPT ); 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-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@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