Received: by 10.192.165.156 with SMTP id m28csp934902imm; Wed, 11 Apr 2018 09:30:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/M1Rh4wrAhELGOrQqGzziKyLBFGKpC3OnlaYyqeyQtkrYF/8xvJx4LTmOx4SGYAmgQgpgT X-Received: by 10.98.163.74 with SMTP id s71mr4617454pfe.72.1523464238665; Wed, 11 Apr 2018 09:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523464238; cv=none; d=google.com; s=arc-20160816; b=hGmAoHvupxeYxHV2KiDQDQ4h//iUPtZWv7foX3P7AiseIGFD+a+d/KLo7w/JbPd82X rrGBpUHCkWRr5H3pcAhWyNHMfgJpkUlkvAzrAZMcddeQc2kHyIFBXRqfa3ucNu16RxIa /JDEY9ZNW/Ywz+kZkpnEOINOS61up1zxme15j+SlKi/TDJS5z+YVfs7t+JN/gRh1ThXY VS2h/Drgf7OqdVlNys7AbVFlnBqc2QAE6ueSaG/Q5KdSjUSYXGUCr3nMsLGDX181uzqz 33U6jTmr/qjzJTpRqXmHNx5qsGD0KqX4+eMW+6sT1XKdB1P/B5SA1phy9N4YPQ0xzqd2 1aOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:arc-authentication-results; bh=iO8RIs8pIu35MgA0/udIw0PNBVSkhdcjhyc61DiWsFk=; b=uDFunDovuKDp2SRzXIaRIZ3ff9nl3bdn8WrZgVH9koHhoohdQ3ZVbw3Z2/60FOFedx 7kWydAJrVj50tXm1HwVi7oNd/jNSuH0tHU3WmO3IEpn8P/2KWXQ8gZCO6QVCwKKpTbSI JJ2gwRP1bbOHir7V/iaYjzv+xFEnFJnEm+ZdIH+7/KzLGgXQ43zZbnGEQRq2mrEE8ZFZ 5NQCBinkj309dgGbg4dfBLkrKt3IfphKRHFaGN0TguLTPYX2f/f/hW2sJEOg96TjZrKq NeQIAzxf/zOfApv3GKpap2eiYtrHyfqnrpfBFKhx7vaiD5j2M/Lh+fMmlyuKgcUGLyGz SPmg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x143si986345pgx.157.2018.04.11.09.30.00; Wed, 11 Apr 2018 09:30:38 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754243AbeDKQ02 (ORCPT + 99 others); Wed, 11 Apr 2018 12:26:28 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753967AbeDKQ0Z (ORCPT ); Wed, 11 Apr 2018 12:26:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC262722C7; Wed, 11 Apr 2018 16:26:24 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-8.rdu2.redhat.com [10.10.120.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id D75EC10B008B; Wed, 11 Apr 2018 16:26:23 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 16/24] Prohibit PCMCIA CIS storage when the kernel is locked down From: David Howells To: torvalds@linux-foundation.org Cc: linux-man@vger.kernel.org, linux-api@vger.kernel.org, jmorris@namei.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-security-module@vger.kernel.org Date: Wed, 11 Apr 2018 17:26:23 +0100 Message-ID: <152346398340.4030.1885177506676553618.stgit@warthog.procyon.org.uk> In-Reply-To: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> References: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 16:26:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 16:26:24 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/pcmcia/cistpl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index 102646fedb56..e46c948d7246 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)