Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3754320img; Mon, 25 Mar 2019 17:36:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqykYxFGoHaVrGo2OvR/jU5UtnrJs1Ub5EjVu+Rgp769t6L3iCyvAlW+Ryapp3lKpw14TTxL X-Received: by 2002:a17:902:bb92:: with SMTP id m18mr10898307pls.316.1553560610160; Mon, 25 Mar 2019 17:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553560610; cv=none; d=google.com; s=arc-20160816; b=EZRLXfixJ/HL8u/YyW3hgeROP46pYFR6dVz/zPaR/RAeUPEGCR15qcbp96SfxARrEK 6xKiFtEYWZ6cEMgQ6slPq05W0WtWqqcwRN8qNld9Yn7jIFzOsNhfKsbSLbKwu8EGHAsf GCCTYSzYSh+ThiT8fgzqxFttyjCEXpkhA1bnWGR7tcZnMLE3N9oRsXnwm4sWKT5cixaC AZazkU4FSzKdCA8JzuELWEPrijfBmQ9cCH0YlOQyyr0oUT7fQo06KHP/2SX3BN8vAVSS am6h768Hb125srJMbEeT6VkYpy4RX1nDNkVPpUknCzNwXOC1xRZzVL7aHHVCRkAvj+pn O6HA== 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:dkim-signature; bh=GgyhudF4OBneofkssVwJOQVnPALSATa/nv58NZdU4Xw=; b=hnXV68pEcvdZ6S7tKDOWFDVFpSNo7U2zbvm8afAFIVgUGqmDJzzLCXVDIuhIeAYNw5 i+GCfPcg8A9XnLxFA3uhfJcGw9PIGaLeslPyzaajwmfGv+GK5hkBe2xQcMIYgfbKpoN3 FPcNVnafhC5JJ/fMi/jccaq+bvto5r23W3hw+WokJUXNrkavKQpyZQB1y0VwtflzQSxa lygoa2Usqn68Nng0y6N9ZxaAmuWejPbou/NdBDcVsQ3AOO6drGuPW35rO61BG6dCZI7r Az5G/n5NIaSzuXHD2uBbihG+ZvTBpliykBFYKT/W7T0U0CZdQm70Sz+Kt+OSKY+aLJUU I5jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hwmkqScA; 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 e25si4718531pgl.514.2019.03.25.17.36.35; Mon, 25 Mar 2019 17:36:50 -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=@kernel.org header.s=default header.b=hwmkqScA; 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 S1730420AbfCZAfu (ORCPT + 99 others); Mon, 25 Mar 2019 20:35:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:58102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730125AbfCZAfu (ORCPT ); Mon, 25 Mar 2019 20:35:50 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7E96206DF; Tue, 26 Mar 2019 00:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553560549; bh=L3xeVJYdIRTDqBMvYIMi/pypjlVgS/mBndEZYjyhDUs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hwmkqScAeT0lY5ymYZ1DleQZwen9mwDTZ04ZKgut6J4JVKIQIl5CYm2SuTxaruPod /tep/+zpLQgM4Rg+i/ULYprS5Ud2cHOoxOT4RtWwiQ3FPpwXOmFvLHkhuAGFIbjZcF owF8v8WW/U3uKxBs2J9ai9ELpcIphT+IISKjVvGs= Date: Tue, 26 Mar 2019 09:31:37 +0900 From: Greg Kroah-Hartman To: Matthew Garrett Cc: jmorris@namei.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, Andy Shevchenko , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, Matthew Garrett , Thomas Gleixner Subject: Re: [PATCH 25/27] debugfs: Restrict debugfs when the kernel is locked down Message-ID: <20190326003137.GB5112@kroah.com> References: <20190325220954.29054-1-matthewgarrett@google.com> <20190325220954.29054-26-matthewgarrett@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190325220954.29054-26-matthewgarrett@google.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 25, 2019 at 03:09:52PM -0700, Matthew Garrett wrote: > From: David Howells > > 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: > > (1) chmod and chown are disallowed on debugfs objects (though the root dir > can be modified by mount and remount, but I'm not worried about that). > > (2) When the kernel is locked down, only files with the following criteria > are permitted to be opened: > > - The file must have mode 00444 > - The file must not have ioctl methods > - The file must not have mmap > > (3) When the kernel is locked down, files may only be opened for reading. > > Normal device interaction should be done through configfs, sysfs or a > miscdev, not debugfs. Then why not just not allow debugfs at all if it is such a "big problem"? Actually, it is a big problem, and I am pushing for systems to not mount debugfs at all these days, but that's a different story... Just "disabling" it entirely for this crazy dream of a "locked down" kernel is fine for me. thanks, greg k-h