From patchwork Sat Oct 31 11:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317368 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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 2F85DC388F9 for ; Sat, 31 Oct 2020 11:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE2D6206A1 for ; Sat, 31 Oct 2020 11:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144921; bh=Cn5yiliAFR5HJk5hipMpfl6sr1twvuJ3ESqVODtkH4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gt2GwtmAfYC++PAUHp9ZUc3eIV3UVj63NtW8VE7l+1jymwPjL0AqI13VbHL1jISZH lKY9oetpKbhLjKq7ao3quM+0ybMYsv7zvZ1thzp/bt/XG4DkG/fKA11AAHVEcRx9tO SRq3rOLzs6LPZ7nEavjkPzeq3hdWodcyi/blR+EA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgJaLnr (ORCPT ); Sat, 31 Oct 2020 07:43:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:43792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727511AbgJaLnn (ORCPT ); Sat, 31 Oct 2020 07:43:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 B7B37205F4; Sat, 31 Oct 2020 11:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144623; bh=Cn5yiliAFR5HJk5hipMpfl6sr1twvuJ3ESqVODtkH4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/e05dc9YRgRUebKMaE82NzMNVw78qTRzVYHHf3tMnv09CnDzoVG0UFkdXzz0EfdH Nhnq3PGZCefPh/N7WzdHvaBOzDgiteIfrBVw8JtGyzCDWoR+i5jhQIzB+sa/fY4Zax DIHnfWyzEx/3oFGb58ZcGG2C2Ii7v+OnOC72J8Bg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Luis Chamberlain , Scott Branden Subject: [PATCH 5.9 19/74] fs/kernel_read_file: Remove FIRMWARE_EFI_EMBEDDED enum Date: Sat, 31 Oct 2020 12:36:01 +0100 Message-Id: <20201031113500.975431483@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113500.031279088@linuxfoundation.org> References: <20201031113500.031279088@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kees Cook commit 06e67b849ab910a49a629445f43edb074153d0eb upstream. The "FIRMWARE_EFI_EMBEDDED" enum is a "where", not a "what". It should not be distinguished separately from just "FIRMWARE", as this confuses the LSMs about what is being loaded. Additionally, there was no actual validation of the firmware contents happening. Fixes: e4c2c0ff00ec ("firmware: Add new platform fallback mechanism and firmware_request_platform()") Signed-off-by: Kees Cook Reviewed-by: Luis Chamberlain Acked-by: Scott Branden Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201002173828.2099543-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/fallback_platform.c | 2 +- include/linux/fs.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) --- a/drivers/base/firmware_loader/fallback_platform.c +++ b/drivers/base/firmware_loader/fallback_platform.c @@ -17,7 +17,7 @@ int firmware_fallback_platform(struct fw if (!(opt_flags & FW_OPT_FALLBACK_PLATFORM)) return -ENOENT; - rc = security_kernel_load_data(LOADING_FIRMWARE_EFI_EMBEDDED); + rc = security_kernel_load_data(LOADING_FIRMWARE); if (rc) return rc; --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2862,7 +2862,6 @@ extern int do_pipe_flags(int *, int); id(UNKNOWN, unknown) \ id(FIRMWARE, firmware) \ id(FIRMWARE_PREALLOC_BUFFER, firmware) \ - id(FIRMWARE_EFI_EMBEDDED, firmware) \ id(MODULE, kernel-module) \ id(KEXEC_IMAGE, kexec-image) \ id(KEXEC_INITRAMFS, kexec-initramfs) \