From patchwork Mon Mar 25 22:09:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 10870209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21B011708 for ; Mon, 25 Mar 2019 22:11:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D35528C1D for ; Mon, 25 Mar 2019 22:11:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 019572905C; Mon, 25 Mar 2019 22:11:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6239229053 for ; Mon, 25 Mar 2019 22:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731085AbfCYWKo (ORCPT ); Mon, 25 Mar 2019 18:10:44 -0400 Received: from mail-ot1-f74.google.com ([209.85.210.74]:43740 "EHLO mail-ot1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731078AbfCYWKn (ORCPT ); Mon, 25 Mar 2019 18:10:43 -0400 Received: by mail-ot1-f74.google.com with SMTP id q23so1483258otk.10 for ; Mon, 25 Mar 2019 15:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=2ssyPCg3POhze4DuCq8LOChiCT8h5s76Ul4XqmSv8/4=; b=Gt2Z+naaOI4jaIW6k6icatZYz0vOiPy2qQ9nWh4sgTRJW+JPWo1rJPvo30ZMFECFRY dgHSFW+svQkWWl66DCDhDd0woNHp+XMrO2ZLUSjv9WtcKjHMozhhMD+MfGNh9FxgW+Dj ZCqjb4BXBWTTp3+LHvpASWsulruWVnM/NdFY/ZqEcdDbdxfTlwwrzvjWZGaUv92IC28E 1YpiArWA+SDGmq/Zj9zxjuWzr4y7OAhA6CHeFzHsFlnNtOd6VOQidtM7KJ5lIKE8a3g1 iwjwSj6qJ5ZcgCMcI98N5Hc8JovlNS+bMh0Pm6YDdgK+JAMlKOupdWfL9u8Q/3d9U5Ss 7Wug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=2ssyPCg3POhze4DuCq8LOChiCT8h5s76Ul4XqmSv8/4=; b=GtKX+Equk3j6jao47Atg3QAiAFI1whkeVXWAjJdn2A3nUnWKotGi/7iAxQIkXGANi/ 6NUDAcGDu/GYJ3EsvSczV5eqbfyOvVJOVr08i8273SR/BNT8AvXJedbMpXRwtv/56P4G VFZN++NHmvq65DN26hN3YgVtyiKcSmugZOTJX5ET+35+V2chVBTFHeavrMsUbZY00zi/ uo3hkqMG3WvC+XNwo72ODMfvZRqpr+Q1WM1R12Cn3Kf8KEvpRBFO1XyAejY55lPHuAyA eRRBx8Y+NO/arfM2H1lBk4/f5/kZY9cIR2qOsAgYa1+p3OZds182qY5MQxnn4K1WSQAf tDcg== X-Gm-Message-State: APjAAAXqwQwiTpdP4vKxu2cls8r3qaIHyxsFABK///LpyJ/SFrBflFmy irgDMQ8XsKqW9T3NuJlITPh6M+xENfParkGSTRv+2g== X-Google-Smtp-Source: APXvYqxi96o+qhxfCxMD7tnM4/PPRFA30e+tCetBW41PK8yY8O9kn57CJsnOy71MxaE6ZAIiNGzV/YN9QkpclEO2gJ3zUQ== X-Received: by 2002:aca:3b56:: with SMTP id i83mr13547187oia.162.1553551842820; Mon, 25 Mar 2019 15:10:42 -0700 (PDT) Date: Mon, 25 Mar 2019 15:09:44 -0700 In-Reply-To: <20190325220954.29054-1-matthewgarrett@google.com> Message-Id: <20190325220954.29054-18-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190325220954.29054-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH 17/27] Prohibit PCMCIA CIS storage when the kernel is locked down From: Matthew Garrett To: jmorris@namei.org Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, Dominik Brodowski , linux-pcmcia@lists.infradead.org, Matthew Garrett Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: David Howells Prohibit replacement of the PCMCIA Card Information Structure when the kernel is locked down. Suggested-by: Dominik Brodowski Signed-off-by: David Howells cc: linux-pcmcia@lists.infradead.org Signed-off-by: Matthew Garrett --- drivers/pcmcia/cistpl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index ac0672b8dfca..8adf092d0e18 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1578,6 +1578,9 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj, struct pcmcia_socket *s; int error; + if (kernel_is_locked_down("Direct PCMCIA CIS storage")) + return -EPERM; + s = to_socket(container_of(kobj, struct device, kobj)); if (off)