Received: by 10.192.165.156 with SMTP id m28csp1106551imm; Fri, 13 Apr 2018 13:24:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++xIQ7RbUi+UEBmGzHQZyhcOSyVJ61YHju1E3XCG+rFHLNcMBATSQNDBPt9lI+rYkVDLjF X-Received: by 2002:a17:902:b691:: with SMTP id c17-v6mr6431443pls.192.1523651052254; Fri, 13 Apr 2018 13:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523651052; cv=none; d=google.com; s=arc-20160816; b=Hh4agikIO2uAAsQ71QgTNgBzhUBzsOGWq7mcCTARe4JiLriKjL2IltWClhZZHFR7EU kgfKbEWdkRgJ5j7i6p8D/F5QxMfCp1f9Hx1AXdAYCoTiBT2e1koy84RS+C6U4kqxHrvT PEuBn1IzQMQNlj8fbw60tozN/0yH4PS8hetIAAOVTGLxf6E7eGKqUdYTJZXzvwcuVS+f a3cxtYHAPvvcd0vUjAIMHcHDMXMv74GQ3ef1FYSJNxN6dbyozI2JztAiO5lxBdW7rYN7 X2A8vA9USSOzxc/qStUCt26ex+kbJsEmCm2vjODjDyjO0s5pkttsP/8r8Z+9qyEfJUDe 5bYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/88hdeQDw0Td52vpuHskav8/kQX+/zYXSGPZiRyKBrI=; b=jD0vX/+1kG2LStBf4H7BQnPwzBd4BkOWcGHEUhEl94ijh9LAc5gxMYgkHm9n4NweIc HqoMZ7y5GXEYRvXhdwnmKWukDXH/uFPyUqmg5l09Gj7UtuAVuyxrA/Pffy79wGMkH4XY cGfHgYp2KEieHfW9AW8XmLmW9rgxBc4bnypAwhPHRhSBWoiqMf/5Q5uRxjwqKK/ypnWh vNQ3dwx8bhfBlGqjtM02tkaWRXGxExkvXhSlbSSHSxwzrIaLbp+DNsUDNbRGa9dR0Uaf Sr4y2OQRDnnWOy+e9II8IPNALohiZNndz9ZSnA8qzkGKeTdvYMGAz5MFp+5+sMQSrLX+ MXig== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si4922299pge.99.2018.04.13.13.23.58; Fri, 13 Apr 2018 13:24:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752050AbeDMUWq (ORCPT + 99 others); Fri, 13 Apr 2018 16:22:46 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:56739 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973AbeDMUWn (ORCPT ); Fri, 13 Apr 2018 16:22:43 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id B23388038F; Fri, 13 Apr 2018 22:22:41 +0200 (CEST) Date: Fri, 13 Apr 2018 22:22:41 +0200 From: Pavel Machek To: David Howells Cc: torvalds@linux-foundation.org, linux-man@vger.kernel.org, linux-api@vger.kernel.org, jmorris@namei.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 24/24] debugfs: Restrict debugfs when the kernel is locked down Message-ID: <20180413202241.GB4484@amd> References: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> <152346403637.4030.15247096217928429102.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dTy3Mrz/UPE2dbVg" Content-Disposition: inline In-Reply-To: <152346403637.4030.15247096217928429102.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dTy3Mrz/UPE2dbVg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-04-11 17:27:16, David Howells wrote: > Disallow opening of debugfs files that might be used to muck around when > the kernel is locked down as various drivers give raw access to hardware > through debugfs. Given the effort of auditing all 2000 or so files and > manually fixing each one as necessary, I've chosen to apply a heuristic > instead. The following changes are made: >=20 > (1) chmod and chown are disallowed on debugfs objects (though the root d= ir > can be modified by mount and remount, but I'm not worried about that= ). This has nothing to do with the lockdown goals, right? I find chown of such files quite nice, to allow debugging without doing sudo all the time. > (2) When the kernel is locked down, only files with the following criter= ia > are permitted to be opened: >=20 > - The file must have mode 00444 > - The file must not have ioctl methods > - The file must not have mmap Dunno. Would not it be nicer to go through the debugfs files and split them into safe/unsafe varieties? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --dTy3Mrz/UPE2dbVg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlrREZEACgkQMOfwapXb+vJzCACfSnkCF/54N13G7pz0zGeDo6ze e6sAn1h0VTYzTyRfA28tZ4D7RyjjUYJU =ESt0 -----END PGP SIGNATURE----- --dTy3Mrz/UPE2dbVg--