Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4527736imb; Wed, 6 Mar 2019 16:02:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwAPzOIOsvjIFUs9MBUfmhi7OrKTftS60mFfZSENNH6TB5jMvnEcE8J9hmoN5Xv6moOFnLa X-Received: by 2002:a63:cf4c:: with SMTP id b12mr8803756pgj.316.1551916930370; Wed, 06 Mar 2019 16:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551916930; cv=none; d=google.com; s=arc-20160816; b=sBS0yi4tZDysTDk027sIsMcbUV7yWkvbQBt9i/D6OByMICPGCXE+wDHXxENZQhaijl iU5S4r3aY9yjMg7mSK14w8tUZJQaGOtOGQ1pf9cHvW9BDrFFkC6eXoT3nDHVWDHGm59U QKkzj2TtQ044p7V8J+4/Z6UT1eMwjOdGL9tc8BiB2Lxe/uL9bXqZTG0ekg3sQimuRP7R 0xA5UfN64+APYBPOn2C2UU3FQxN9H5JNpOq79RgExrJQ6SRLTw167wXaNXJoZGTkHsid lrqooVyVgjZJQRdPR8fTkrGtJv73zrRnraMCWgZDq55EvBxMnneYDSGlF49p6GW1GJth 5hHw== 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=EeAsNLooacMCIyQQG8kjyYl9LfYTYq2OlHNVaSq+jF4=; b=IUa2BSjcRlBXuzSRKfYtxS+cEAhW3fLdlz8BtCTU787PhFKbepWGe1tVPxry+0vVzU Uv6SK43+6TQ/18tve21/CrF1lDkDHegs5uwZngyA82Nzr+L95Wew0B/hLFVil6LJn6iD pToWXE3Ch85kfLKmct85tlMLajcNnOgnzzjLMlHCi8E86MFKbShfu5tH+EcBVVJrbteX Z1MIvMhj71SbBztXmTmU1Y0YeeKfC7zeY8/9tAv78fY8r2Y1nUlLfPAA7Y9+vMRcaa/j LnkUhhGURODTbAQ9uqXHf+ueph241AigsZcfIaBGKZvUfrfHc0pzmqKBkL0oJVnaN1sH TJeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BXibPNAU; 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 72si2778030ple.250.2019.03.06.16.01.55; Wed, 06 Mar 2019 16:02:10 -0800 (PST) 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=BXibPNAU; 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 S1726632AbfCGAAQ (ORCPT + 99 others); Wed, 6 Mar 2019 19:00:16 -0500 Received: from mail-qk1-f201.google.com ([209.85.222.201]:54148 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726612AbfCGAAN (ORCPT ); Wed, 6 Mar 2019 19:00:13 -0500 Received: by mail-qk1-f201.google.com with SMTP id z123so11621178qka.20 for ; Wed, 06 Mar 2019 16:00:13 -0800 (PST) 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=EeAsNLooacMCIyQQG8kjyYl9LfYTYq2OlHNVaSq+jF4=; b=BXibPNAU2kBLKi0tjOaBoATPK4GSG9rdLOziADGyltDJLflexEotgn/YIOIEl1Fm1H yMKiAZuRKAYyc2wi9Z9d4o35i6BvJDlVbS0M3iQvUIZits5qZwr7R60IUQGPdO6d5eWg oqY4UJoLQdmZJ2B0X2IxvA0M9/CXZx0HcS1UqVad8pRlnNi2MHHBlTg276gQPOoUjJVU jXR9xzzJ/1LnMTEgqx6l/1wlLediq2tk6EewVxCYv9Ajdlki6r3EAt3+eXpztFNwMs93 3/hzDEIcglR4a8m9b8Zr9hyDIA0YZdse4rBnWiIpPApIuSjtOjoQUODVtRMhiygVCjIw lwFw== 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=EeAsNLooacMCIyQQG8kjyYl9LfYTYq2OlHNVaSq+jF4=; b=tyM9wWz2KlzJn7dXfhCc5sKsB0uGuTgfIgG5qscTTAtHD4YndIRe+OBTzqGKHURChu QLI+1Uhx35UTwlwM6e1nHRMALNDKLaMI+vFp/ya71o0Gf9cXnrRavZl4wULW5zyyizMX jcdDl1k9Voe5UkU52KmFN2mb0XOlTM314zh/AmI5LpPH2p9BjLo2rOwy8AWeyBwZ6cbP sbvLLgpYCPv8ZJ0e6DWWDbDVuDnydsp1YCByRDULTzf+g3MkGJ9cSnwn/4M7hhg6Oey+ 3k4FDyW9ZJhh4S+5on8RuOccbhxzQ/bxPaMQqhkoed+7g34HcP+YKVnAg6i8Cq92WgeO frtw== X-Gm-Message-State: APjAAAVmuAuDXmQE2j8H8MlqLpPLT1c0CBNuUAGW04uqxCwdC0CfiBH4 7Kk2s/f2+LuN2pipN7el0rIludnQKGdTPQDhiCc8Fw== X-Received: by 2002:a0c:b10f:: with SMTP id q15mr6331977qvc.0.1551916812836; Wed, 06 Mar 2019 16:00:12 -0800 (PST) Date: Wed, 6 Mar 2019 15:59:04 -0800 In-Reply-To: <20190306235913.6631-1-matthewgarrett@google.com> Message-Id: <20190306235913.6631-19-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190306235913.6631-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH 18/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 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.352.gf09ad66450-goog