Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3662793img; Mon, 25 Mar 2019 15:12:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzQhCMZ5VOKjUuIy26vd0xgoIJ9fhpCSkW/yGEF+K3IE6cMXsoA7FRf65YQSy6pLybKoip X-Received: by 2002:a17:902:9304:: with SMTP id bc4mr28054240plb.81.1553551927175; Mon, 25 Mar 2019 15:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553551927; cv=none; d=google.com; s=arc-20160816; b=bQMYWPJ4x7xEfmOU4kLFIlmNP/AdP04GNO9JVp6WG6HaPFIS4ISHmiSKtKN1OIE9np elFRk5CK5mO2pFFTJlRWmIQbYPfmxK6TFH1LcdTKDKjBVB/eRCUe4xWwoY3n0+M8oDaH kfpfjqKwL3N6POTvtxYB9QEXVWG0qVdh4dgmlQvO7mKCT0sPxN71Pa0RXKazfbWwcmzt jw4FrTA8tJe955YXhElEbSrj7kOSquCirBTV3s4uzgkGFVdqT90d8YSy+DH57MBfL9AD xRriWD5aZcNKegYlZwlmTiWOzOBais9LYs9htdQrScKS0lZvB87Lm2zpS422b8eL2CNR ksFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=2ssyPCg3POhze4DuCq8LOChiCT8h5s76Ul4XqmSv8/4=; b=ZoQEJVvB/pYDXYgSJgbZ18J3iQJUUoicAYEJHB7JucbrI6m2Qh4X7J8K09hd0JZjZh 192w3vRgxnp0PzyKriApb3ZkueJiB+8eqSKaI3tlDooBE/nwsTIIaRMwl+8HX1BGmKO8 6YATnF21IIuHRqJLIqnK1S5hV5NBGIsgri7mjtSvval9HPCYT81R+wl+jEhOW5agSbCD PZB3vcN1DbNqxP8jITs/0TQ07keTvgDIB2HHLd8fmIOP7gPZR6XCnISVKInDThUEyg+Z xojDmjb9CeoL5F4BB5dWr5XtVQ3RhZbBcdAk5W3D8GwwRm+avYriM5dZ/53J1bQC8F1l 2yhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Gt2Z+naa; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si13911562pfh.95.2019.03.25.15.11.52; Mon, 25 Mar 2019 15:12:07 -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=@google.com header.s=20161025 header.b=Gt2Z+naa; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731097AbfCYWKq (ORCPT + 99 others); Mon, 25 Mar 2019 18:10:46 -0400 Received: from mail-oi1-f201.google.com ([209.85.167.201]:54544 "EHLO mail-oi1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731077AbfCYWKn (ORCPT ); Mon, 25 Mar 2019 18:10:43 -0400 Received: by mail-oi1-f201.google.com with SMTP id w139so4442906oiw.21 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=mWPxvbMjo857FbkEkYzpLcc009iPxHr9TzUL8tZT0ou/MXgyXU4/RaPbnH0Y3gWaWS e2ltwYa8W5xjHqYb+NV6YW4RweQBgAJLlYfElBIEcvJMMZ86rZIhexxxMXCUFFrN0yTl DblVxq1q/jGF1ubbVb5e4R5YqB4dnY9lT1uom/ELw5LoCbC9K3ZUjUukvjQN/DstJ5MR +KVMdeOEr4CEBfIdJxnM/B4bnWTeUVExIwQm4Hr5IyGC/21kGtWGoEvknpiYMxt2WlmP 8mDWxD7l60xbf018NVtAyl38QMml1QO0UzXIu2NKrfSiFlgJ0j6sWG8ahFlaqSk3g7BK ZWiA== X-Gm-Message-State: APjAAAVcozVvnw3Z+D9bedbwaO1xuRoL3LsKjJp52btK0VO3aVxV+21Q tMkmZY8Ovm839O+akgYRe+C8CZJtPhEMsQGAZ5BPHQ== 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 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 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) -- 2.21.0.392.gf8f6787159e-goog