diff mbox series

[v2,2/2] platform/x86: samsung-laptop: set debugfs blobs to read only

Message ID 20210504170030.58447-2-wsa+renesas@sang-engineering.com (mailing list archive)
State Superseded, archived
Headers show
Series [v2,1/2] platform/x86: samsung-laptop: use octal numbers for rwx file permissions | expand

Commit Message

Wolfram Sang May 4, 2021, 5 p.m. UTC
Those blobs can only be read. So, don't confuse users with 'writable'
flags.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Change since v1: use octal numbers

 drivers/platform/x86/samsung-laptop.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko May 4, 2021, 5:38 p.m. UTC | #1
On Tue, May 4, 2021 at 8:18 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> Those blobs can only be read. So, don't confuse users with 'writable'
> flags.

Not sure if this should be the second patch in the series (sounds like
a potential fix).
Either way
Reviewed-by: Andy Shevchenko <andy.shevchneko@gmail.com>

> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Change since v1: use octal numbers
>
>  drivers/platform/x86/samsung-laptop.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
> index 763d97cbbe53..9aa0de8b7581 100644
> --- a/drivers/platform/x86/samsung-laptop.c
> +++ b/drivers/platform/x86/samsung-laptop.c
> @@ -1296,12 +1296,12 @@ static void samsung_debugfs_init(struct samsung_laptop *samsung)
>         debugfs_create_u32("d1", 0644, root, &samsung->debug.data.d1);
>         debugfs_create_u16("d2", 0644, root, &samsung->debug.data.d2);
>         debugfs_create_u8("d3", 0644, root, &samsung->debug.data.d3);
> -       debugfs_create_blob("data", 0644, root, &samsung->debug.data_wrapper);
> -       debugfs_create_blob("f0000_segment", 0600, root,
> +       debugfs_create_blob("data", 0444, root, &samsung->debug.data_wrapper);
> +       debugfs_create_blob("f0000_segment", 0400, root,
>                             &samsung->debug.f0000_wrapper);
>         debugfs_create_file("call", S_IFREG | 0444, root, samsung,
>                             &samsung_laptop_call_fops);
> -       debugfs_create_blob("sdiag", 0644, root, &samsung->debug.sdiag_wrapper);
> +       debugfs_create_blob("sdiag", 0444, root, &samsung->debug.sdiag_wrapper);
>  }
>
>  static void samsung_sabi_exit(struct samsung_laptop *samsung)
> --
> 2.30.0
>
Wolfram Sang May 4, 2021, 6:10 p.m. UTC | #2
> Not sure if this should be the second patch in the series (sounds like
> a potential fix).

Not a fix. The write will be rejected anyhow. It just looks strange to
have writable permission when there is no proper callback for it.
diff mbox series

Patch

diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index 763d97cbbe53..9aa0de8b7581 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -1296,12 +1296,12 @@  static void samsung_debugfs_init(struct samsung_laptop *samsung)
 	debugfs_create_u32("d1", 0644, root, &samsung->debug.data.d1);
 	debugfs_create_u16("d2", 0644, root, &samsung->debug.data.d2);
 	debugfs_create_u8("d3", 0644, root, &samsung->debug.data.d3);
-	debugfs_create_blob("data", 0644, root, &samsung->debug.data_wrapper);
-	debugfs_create_blob("f0000_segment", 0600, root,
+	debugfs_create_blob("data", 0444, root, &samsung->debug.data_wrapper);
+	debugfs_create_blob("f0000_segment", 0400, root,
 			    &samsung->debug.f0000_wrapper);
 	debugfs_create_file("call", S_IFREG | 0444, root, samsung,
 			    &samsung_laptop_call_fops);
-	debugfs_create_blob("sdiag", 0644, root, &samsung->debug.sdiag_wrapper);
+	debugfs_create_blob("sdiag", 0444, root, &samsung->debug.sdiag_wrapper);
 }
 
 static void samsung_sabi_exit(struct samsung_laptop *samsung)