Re: [PATCH 2/2] debugfs: Add access restriction option

From: Randy Dunlap
Date: Wed Jul 15 2020 - 23:30:59 EST


Hi,

On 7/15/20 8:25 AM, Peter Enderborg wrote:
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 9ad9210d70a1..aec81f38bfce 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -476,6 +476,38 @@ config DEBUG_FS
>
> If unsure, say N.
>
> +choice
> + prompt "Debugfs default access"
> + depends on DEBUG_FS
> + default DEBUG_FS_ALLOW_ALL
> + help
> + This select the default access restricions for debugfs.

selects restrictions

> + It can be overridden with kernel command line option
> + debugfs=[on,no-mount,off] The restrictions apply for API access

,off]. The

> + and filesystem registration. .
> +
> +config DEBUG_FS_ALLOW_ALL
> + bool "Access normal"
> + help
> + No restrictions applies. Both API and filesystem registration

apply.

> + is on. This is the normal default operation.
> +
> +config DEBUG_FS_DISALLOW_MOUNT
> + bool "Do not register debugfs as filesystem"
> + help
> + The API is open but filesystem not loaded. Client can still do
> + their work and readed with debug tools that does not need

and read that do not need

> + debugfs filesystem.
> +
> +config DEBUG_FS_ALLOW_NONE
> + bool "No access"
> + help
> + Access is off. Clients get EPERM when trying to create nodes in

-EPERM

> + debugfs tree and debugfs is not registred as an filesystem.

registered as a filesystem.


> + Client can then back-off or continue without debugfs access.
> +
> +endchoice


Also, in many places in this Kconfig file, the indentation needs to be
fixed. Some lines use spaces instead of one tab for indentation.
Help text (under "help") should be indented with one tab + 2 spaces.


--
~Randy