Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3757771ybd; Tue, 25 Jun 2019 08:01:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz745LvdtopiBZkn+wKsg0nHFi05wv9Y1yUFEBj0ZEyn8+P6g8tL7Qx+7DbOAXKMffequa5 X-Received: by 2002:a17:902:1003:: with SMTP id b3mr157168647pla.172.1561474879085; Tue, 25 Jun 2019 08:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561474879; cv=none; d=google.com; s=arc-20160816; b=f1LWPKckntIk5nUWaFp2R2fD00xcdRT/11EXMt0KMBCVMx+BbTthgFInCVpFQHfNsB avkB6h1dMh+T4W+suezzf7qRaqsqotnFBFpnIWELPODclCu4H6lZcT1gfmaBAtbAAXr9 yUgIThCMFdvARWG4mF/hqEYAfl9re3Lq6K0+OMLjOioth8eJ7JZu0b+ygJvVrN8f+ODF 7dF3LyVKler2qwDgLJjcMChTHup5lUFJ8U3Nwtp7XiN7EfQX0LJ9uEvvfhlydYgyEy0Y k/EBh6lx2bZmboTOuh+mouOLbq6yjAIC6HJHOO4H8tiyPSuT0/zPwnw5N3i4A7wkvuGo ZF5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WCu2izc+AwFs8dxkBWfG0kU/xQQY4HsLibUm2/EhQEg=; b=KFXAFteN0k6rNVhh6KmY2yGgSiSL+3pULxWc503KdPCEfcDizFf957FVzFNQn0WPI3 6TVYU4cvdyVvu9E4GV7vDUFNVY6VoB+AoWgGGnUEwI8WQW4qpsRfjCOICttGsu09HZbZ +FKLKcaMYuccBYQE0Fkv9Uz87b5VrpxIphcUDoqN0HI9Q9/oFG/WRL8tvVJYm+eRLous GdmeEi5gBi4hbUolqADuCe3ql21+3YqfiGNgnF59lb9un+uGem0YS6rHo4whlOWG0d5C 9mgBSZqj9AUzuAP2ZCawINsbVE8NOKlhbLKHscmZO8fwU0cZIzzY1D8PfUGXIakeQUFt +Kjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XEkdwu9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si522742plb.177.2019.06.25.08.01.03; Tue, 25 Jun 2019 08:01:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XEkdwu9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731995AbfFYPAg (ORCPT + 99 others); Tue, 25 Jun 2019 11:00:36 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:34432 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731965AbfFYPAg (ORCPT ); Tue, 25 Jun 2019 11:00:36 -0400 Received: by mail-io1-f66.google.com with SMTP id k8so993518iot.1 for ; Tue, 25 Jun 2019 08:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WCu2izc+AwFs8dxkBWfG0kU/xQQY4HsLibUm2/EhQEg=; b=XEkdwu9tbyxynV2UESVQpvwU3iwK3hOE1k9Q1V76kobtha4OFJg8EuxOwyr9iFmFCF 03+IP8ze/+IkOWgqwTpYK3IA+caa2YfQYz/eo6KfpwPMDhq0+7/rvOJSrpLmt6w+CQny NEdRK0dC/Ou/b9ECjr3caBsF5fwJhkr+xfFWaaDRwrRWL3rhMeeWH8HFoBrAKmYGIkva h4nN/l3U6DtLZdNSOnQL9Ih7R4Vh9q25kWm87wwuDzJtxPiQd0g9nyeidql+/whr0yY8 hRSCFlzTYLEpYV2kxsIbsi+thmD6DyDRJf9PwCSIWPW0GUf18A1wZrVKYFPGX3EEcJNl GGvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WCu2izc+AwFs8dxkBWfG0kU/xQQY4HsLibUm2/EhQEg=; b=Y+VnDNjgsgCqJzvWPcyXbokuoRinXzMmpbQ5Aut6DqrWr3U9fM53qugOKzKCAp++3S RrsNpqN+9J32hqKNCrVCBU/Rc2iD5yGd7TD7OKWtV+Blj+cOxYVuQ+Vffle5vo68qglu FZsqzT6hrVgvdUQnFu/Djqxm483hEH2AEHr9L2r/yuy3ozEh+ypT643tdIu8vpHcK/4Q YqVMcb8Fb5KDF3r7KVHt+btkqGzt4XKfjECO+rHZn/hDHXl2QHuaK0u/Nb7G38qgJrrn 7ldDVNlIMHGNPNagZ+SuOjqTboZRYcTuer4plkkvkL36xxVt1USYTapYvio/KljCy9oy 0zSA== X-Gm-Message-State: APjAAAUqWlNiMnQBRH8IQYsz6WPMIHInEVRr11mC0J2InuoYen9di2Xy G1gyKfhBMzoIZ0dGPXK283keL0iyFJOfNPCzCPp2Nc/hBOk= X-Received: by 2002:a02:c90d:: with SMTP id t13mr112928904jao.62.1561474835326; Tue, 25 Jun 2019 08:00:35 -0700 (PDT) MIME-Version: 1.0 References: <20190622000358.19895-1-matthewgarrett@google.com> <20190622000358.19895-29-matthewgarrett@google.com> In-Reply-To: <20190622000358.19895-29-matthewgarrett@google.com> From: Ard Biesheuvel Date: Tue, 25 Jun 2019 17:00:24 +0200 Message-ID: Subject: Re: [PATCH V34 28/29] efi: Restrict efivar_ssdt_load when the kernel is locked down To: Matthew Garrett Cc: James Morris , linux-security-module , Linux Kernel Mailing List , linux-api@vger.kernel.org, Matthew Garrett , linux-efi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Jun 2019 at 02:05, Matthew Garrett wrote: > > efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an > EFI variable, which gives arbitrary code execution in ring 0. Prevent > that when the kernel is locked down. > > Signed-off-by: Matthew Garrett > Cc: Ard Biesheuvel > Cc: linux-efi@vger.kernel.org Acked-by: Ard Biesheuvel > --- > drivers/firmware/efi/efi.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c > index 55b77c576c42..9f92a013ab27 100644 > --- a/drivers/firmware/efi/efi.c > +++ b/drivers/firmware/efi/efi.c > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > > #include > > @@ -242,6 +243,11 @@ static void generic_ops_unregister(void) > static char efivar_ssdt[EFIVAR_SSDT_NAME_MAX] __initdata; > static int __init efivar_ssdt_setup(char *str) > { > + int ret = security_locked_down(LOCKDOWN_ACPI_TABLES); > + > + if (ret) > + return ret; > + > if (strlen(str) < sizeof(efivar_ssdt)) > memcpy(efivar_ssdt, str, strlen(str)); > else > -- > 2.22.0.410.gd8fdbe21b5-goog >