Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2570514ybt; Mon, 22 Jun 2020 01:33:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC10WjcrhMZ6AYjQCDkyZTzyfCyMcMc57YlTzHDOQHoE1hohZcH8L+wdby5qJVQWvBG+WP X-Received: by 2002:a50:934e:: with SMTP id n14mr15892350eda.88.1592814793866; Mon, 22 Jun 2020 01:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592814793; cv=none; d=google.com; s=arc-20160816; b=fsthEiqaGE+BAkynGGyHLmc0UvgT39bp8RlgR8mNZ3tstOUSXj3dSA9ojkoSwynBCE ZEeI8K/wwSFKDo6stRwJR6KPxPa49iPjwmnUPl6/7GKdNobgeuI7XxF41oGqdffN3wRb 6vwg8FsA/2O/s6hzBMkXhRBF/qLzKXg1djxZU3xxMjwcB+NEgKYQ2yy9OEQ99GxcAux2 ZV08UoY+v7v2NxD7ccrOUG0AEPkS4m/kuHwWZ0oVqf9SU2qupEIkMwWZSwQqP/R6OFzr gNZU8MFA0BODtby/vbgNP7UDoqs9nqXXSydNXVp7rFGpwITov38KRVQSMSrJUVBVbuCi 1+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=ZVFSs9VWjLOHXlA9+aawODfvtZjrRz/k3CMuSpFCaNM=; b=Wsrnv40mh7oxvMJ7gNXdhiM6HTwvTAy72g8PYkDvMj0WARy89yfHY6RxVvVHlGHVW6 8FuPBdh8iqu3LNQKQmDIoURSW/ukykjqRNTcS2T36BNrdxEIW1nbyjK+83ZTr7L0Y7a4 TgLHTVxjuW/X2cN/XIMFfQqUxagIWpGIVkrmxMTOcMHsiIB3l34SxwhwTZEdVbGz2iQf WNIjUOnhZJLNQb6uiU3YLbkYHsHHuPHGlJ8oJuLq1ULlJpSTY3cUjNs+Oyof8poGVUmt pyqMWUaVur6fOjgJTvekqXJG95d5x58YP2saZW7PoiauXA5AIIsnABNSB2T/XX1W3WDy vUrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si8796545edy.606.2020.06.22.01.32.51; Mon, 22 Jun 2020 01:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725910AbgFVIan (ORCPT + 99 others); Mon, 22 Jun 2020 04:30:43 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:15462 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgFVIam (ORCPT ); Mon, 22 Jun 2020 04:30:42 -0400 From: Peter Enderborg To: Greg Kroah-Hartman , , "Rafael J . Wysocki" , Andrew Morton , Jonathan Corbet , , Randy Dunlap , Steven Rostedt , Ingo Molnar Subject: [PATCH v4 0/2] debugfs: Add access restriction option Date: Mon, 22 Jun 2020 10:30:17 +0200 Message-ID: <20200622083019.15479-1-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617133738.6631-1-peter.enderborg@sony.com> References: <20200617133738.6631-1-peter.enderborg@sony.com> MIME-Version: 1.0 Content-Type: text/plain X-SEG-SpamProfiler-Analysis: v=2.3 cv=B7jHL9lM c=1 sm=1 tr=0 a=kIrCkORFHx6JeP9rmF/Kww==:117 a=nTHF0DUjJn0A:10 a=QyXUC8HyAAAA:8 a=KbOOyE1mfVfSFiGyvBAA:9 X-SEG-SpamProfiler-Score: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on systems where user-space services with system access are attacked. v2. Removed MOUNT as part of restrictions. Added API's restrictions as separate restriction. v3 Updated Documentation after Randy Dunlap reviews and suggestions. v4 Removed #ifdefs from inode.c and using internal.h for configuration and now using BIT() for that. Function is now always on, and are instead selected by a built in default or command line parameter. Added preparation patch that removes check debugfs is initialised. Reported-by: kernel test robot