Message ID | 20200619165010.645925-46-seth.forshee@canonical.com |
---|---|
State | New |
Headers | show
Return-Path: <kernel-team-bounces@lists.ubuntu.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49pPxH4SByzB4Cb; Sat, 20 Jun 2020 02:52:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from <kernel-team-bounces@lists.ubuntu.com>) id 1jmKFi-0008PP-Ql; Fri, 19 Jun 2020 16:52:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <seth.forshee@canonical.com>) id 1jmKEQ-0007MP-H8 for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:51:10 +0000 Received: from mail-il1-f200.google.com ([209.85.166.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <seth.forshee@canonical.com>) id 1jmKEO-0006QN-Tq for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:51:09 +0000 Received: by mail-il1-f200.google.com with SMTP id c11so6898052ilq.0 for <kernel-team@lists.ubuntu.com>; Fri, 19 Jun 2020 09:51:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AwYcIsdy0Sw03kYMfbvUFlWqCJhDqXXwh6mECPJ4aSs=; b=jbwtSHEtfsoJPtXOgDxRl6lCx5gdCIwJyypPeZOu32I+SyzWFwVqsKzNPWV1lR/s3D 5hktoTBBDsgbAIymdR6kNzDdOoCrv9FFzwfvJoFLO4EwePmBYQxdjHYvbY4V/6rEK0MC IvUcdlR1x3uN1Bvwwj+C0HWXpYMr2ePVElvZuymmbSi1SW3HwUcZy16ukJltf22GHofi nAGuiRR5aNTtS2wjwKvaJBQ+iGozDDT9xOWHb79XG0mjH2kKJZv+zWHwTxQEx4v5gA7d iJIQEKim63S4Au1MVyBshrBHTSukEGdg9fJlfZQAA+8KjXKaL3BLekzNpXl2AaFD16e7 sGDQ== X-Gm-Message-State: AOAM5302IqzdtE2zrP5zcchUY8uNY8JbL/LfotV9oenQPpMC81Jv5vjE wyEiYct39d71+zvKQ7ZbfiZTRXwI9jMBF4qygK1rVlr26aKGTq7Y9mUnK39GlpWtT5OXnYynREZ iJEyTprk5EMGKfNR/JnnJbmsOMZUD008Po18UZ1XNlg== X-Received: by 2002:a5d:8458:: with SMTP id w24mr5388352ior.65.1592585467773; Fri, 19 Jun 2020 09:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMWm0k7x8zgF+mdiCXm0TOgK7+xAvr6c6w+/BRe5jXx66+YUGFx0gB92pYcwlNvTh1QwLPLg== X-Received: by 2002:a5d:8458:: with SMTP id w24mr5388331ior.65.1592585467524; Fri, 19 Jun 2020 09:51:07 -0700 (PDT) Received: from localhost ([2605:a601:ac0f:820:f090:1573:c2fc:6389]) by smtp.gmail.com with ESMTPSA id l138sm3499942ill.63.2020.06.19.09.51.06 for <kernel-team@lists.ubuntu.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 09:51:07 -0700 (PDT) From: Seth Forshee <seth.forshee@canonical.com> To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 45/57][X] UBUNTU: SAUCE: (efi-lockdown) kexec_file: Disable at runtime if the kernel is locked down Date: Fri, 19 Jun 2020 11:49:58 -0500 Message-Id: <20200619165010.645925-46-seth.forshee@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619165010.645925-1-seth.forshee@canonical.com> References: <20200619165010.645925-1-seth.forshee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions <kernel-team.lists.ubuntu.com> List-Unsubscribe: <https://lists.ubuntu.com/mailman/options/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe> List-Archive: <https://lists.ubuntu.com/archives/kernel-team> List-Post: <mailto:kernel-team@lists.ubuntu.com> List-Help: <mailto:kernel-team-request@lists.ubuntu.com?subject=help> List-Subscribe: <https://lists.ubuntu.com/mailman/listinfo/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" <kernel-team-bounces@lists.ubuntu.com> |
Series |
Lockdown updates
|
expand
|
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 6030efd4a188..14d19eda9ec9 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -317,6 +317,12 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd, if (!capable(CAP_SYS_BOOT) || kexec_load_disabled) return -EPERM; + /* Don't permit images to be loaded into trusted kernels if we're not + * going to verify the signature on them + */ + if (!IS_ENABLED(CONFIG_KEXEC_VERIFY_SIG) && secure_modules()) + return -EPERM; + /* Make sure we have a legal set of flags */ if (flags != (flags & KEXEC_FILE_FLAGS)) return -EINVAL;