Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4545477img; Tue, 26 Mar 2019 11:31:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuDcMJ58I2NEpQ6qTHLhxLSwzB2kLuqjdvsjd8Yx6uw6FSzJocFex1kj9frLDvbtskjKhe X-Received: by 2002:a17:902:bccc:: with SMTP id o12mr31257768pls.70.1553625060258; Tue, 26 Mar 2019 11:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553625060; cv=none; d=google.com; s=arc-20160816; b=DNrPJjeIp0/q/Vy8JqV+6xCwdqkRhKB1NrgNWUAWBymsUv0/nxRCqaKYBXoF3HWoF0 INstIAOWVz6VXhRwkOWIAGwCqohmKs5dkW/6yMqJFFvt7tb5OASlnL4py8M7mTKtAL9k 9QQq7l3SGNxpNT0zRhcoa0p/hcdVe5pX5QVGeJAFhX89M79zvdsw7+SsE7uRIRwrO/TW 4uL/zxbkZaenZ2bR3k/VjXW/J/HclwTsA5MoQXFMSwOKoUxLkO0CodtXnPI6QEB/Oo99 P7RasuIPa+CqGQTlPr+GiZP2cTO0yUKiqJ/mq0CFTdzYyzlPUfNBsZVqfTWA7r2p9Uxr 3gWw== 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=4G8m95jwtwdfjA5z7EFk9aUl9ztD0RqYosPZp4xmjEc=; b=du4je9IK4FXj5HKDQ5RE3YCIr8ecom5b1f9j0hktHNHeJ0YRNSZwPh1SSSMpsug0JK liVwvDDKH6SPF97xBZNTQ9S48Jzmaz4Ddh3UZoAJYuKrd7V/w+oZIemOddo7DRrNpHcW KTJ5u6nhw+ca12D8Fn47SsPt9I7cxE2WWIv6gSm2WIkFH2RRmv59WL6Gx8bCenWDWhRH rdkC1zG7JWxmr4RcIfWdICoY+KiP0O85GzUfVzKw2gT+ncCwAPyRj2t88PcR8AovTk44 mgZdxXATJAXDB6VJQeNXmlWfZbICSsUw+dmVm5M+6ObyqbZtvZmSx0JHSPK2ABQ4HI7U bAkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h7dNOb7R; 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 v9si16219825pgs.438.2019.03.26.11.30.44; Tue, 26 Mar 2019 11:31:00 -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=h7dNOb7R; 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 S1732788AbfCZS2j (ORCPT + 99 others); Tue, 26 Mar 2019 14:28:39 -0400 Received: from mail-qt1-f201.google.com ([209.85.160.201]:37001 "EHLO mail-qt1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732749AbfCZS2g (ORCPT ); Tue, 26 Mar 2019 14:28:36 -0400 Received: by mail-qt1-f201.google.com with SMTP id f89so14453012qtb.4 for ; Tue, 26 Mar 2019 11:28:35 -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=4G8m95jwtwdfjA5z7EFk9aUl9ztD0RqYosPZp4xmjEc=; b=h7dNOb7RQMavv0sp0Zow1gRw63LnZH39UfrTPdhj02fkrvrZrEAZH78cfkEj+UQc+0 CJjusC/IoWX8sWu5YfQZWyBfIgCg1kdW7WmC1R0rHpjM1s0mtPsNpGYbUAw46xxOqXel 5tAmEK9SZvRqh7JM+1CynPqgm4agy0u9BCaznisqLEyI4iz7fwYVAXlnEe3mqReVkYi5 4mr/vqCxtGCrvpZY5FgmdB521DBRBqUSK5XY3wb/gMVqgChTLP1opGEFzTWsSfXhNHwd HVr3wnpU0+ls7oaLhQK8AaYMFujCCN2584QK2ScCQc8RLOMnVgvxdxBTdqIU+FBrYXyX 6JOw== 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=4G8m95jwtwdfjA5z7EFk9aUl9ztD0RqYosPZp4xmjEc=; b=IXm5Gk9OgxvueySvAjRHgZbYGy0DlsCS3PKTGZpj7Fe+oQTR7uM3P17V1QPgF3HHfi nb70F3bDn8qB1WRDpL61/mlzSLWNTVoj3fZ3Ifr2C6pro04ihNMme61+qHeZUushiwEK fyJdaItHEN01z+QyVvPOKGGEGAuLTCg+4PuHXbN0aoShdxtsMj+XHjG16YUr5IR8f58X BprO1v8vSqLFSNS1RECz4WlBK2+CoLBQnYbUsTlfo5+M4z+OmWqPlFwUmEoEpInWbsQp S1p4GP6MQ3pLU9C3nFurHEeSgOJt5yevGATzv3mniab6/uCvbePr778TRdJ4VrA+dpKr w20Q== X-Gm-Message-State: APjAAAXSMxeciuy3vjmcrKh6wnaREAeCUViKSXmpPS66baf+IiDGU6gQ 3PCubLNMJ+gSqRHNwsCGefWBxU+8Z9//0N+Bk3/Biw== X-Received: by 2002:a05:620a:1428:: with SMTP id k8mr24386884qkj.185.1553624915314; Tue, 26 Mar 2019 11:28:35 -0700 (PDT) Date: Tue, 26 Mar 2019 11:27:32 -0700 In-Reply-To: <20190326182742.16950-1-matthewgarrett@google.com> Message-Id: <20190326182742.16950-17-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190326182742.16950-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH V31 16/25] 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, linux-api@vger.kernel.org, luto@kernel.org, Dominik Brodowski , 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 Signed-off-by: Matthew Garrett --- drivers/pcmcia/cistpl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index ac0672b8dfca..9e23300a55e5 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c @@ -1578,6 +1578,10 @@ 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", + LOCKDOWN_INTEGRITY)) + return -EPERM; + s = to_socket(container_of(kobj, struct device, kobj)); if (off) -- 2.21.0.392.gf8f6787159e-goog