Skip to contentSkip to conversation

nfc: virtual_ncidev: change default device permissions

PATCH Applied Thadeu Lima de Souza Cascardo 4 participants 4 messages Nov 25, 2021 – Nov 26, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfc: virtual_ncidev: change default device permissions

Device permissions is S_IALLUGO, with many unnecessary bits. Remove them and also remove read and write permissions from group and others.

Before the change:
crwsrwsrwt 1 0 0 10, 125 Nov 25 13:59 /dev/virtual_nci

After the change:
crw------- 1 0 0 10, 125 Nov 25 14:05 /dev/virtual_nci

---
 drivers/nfc/virtual_ncidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/virtual_ncidev.c +1 -1
index 221fa3bb8705..f577449e4935 100644
@@ -202,7 +202,7 @@ static int __init virtual_ncidev_init(void)
 	miscdev.minor = MISC_DYNAMIC_MINOR;
 	miscdev.name = "virtual_nci";
 	miscdev.fops = &virtual_ncidev_fops;
-	miscdev.mode = S_IALLUGO;
+	miscdev.mode = 0600;
 
 	return misc_register(&miscdev);
 }
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thadeu Lima de Souza Cascardo

Device permissions is S_IALLUGO, with many unnecessary bits. Remove them and also remove read and write permissions from group and others.

Before the change:
crwsrwsrwt 1 0 0 10, 125 Nov 25 13:59 /dev/virtual_nci

Quoted 8 lines

After the change:
crw------- 1 0 0 10, 125 Nov 25 14:05 /dev/virtual_nci

---
 drivers/nfc/virtual_ncidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Best regards,
Krzysztof

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Thadeu Lima de Souza Cascardo

drivers/nfc/virtual_ncidev.c

Quoted 16 lines · Thadeu Lima de Souza Cascardo

Device permissions is S_IALLUGO, with many unnecessary bits. Remove them and also remove read and write permissions from group and others.

Before the change:
crwsrwsrwt 1 0 0 10, 125 Nov 25 13:59 /dev/virtual_nci

After the change:
crw------- 1 0 0 10, 125 Nov 25 14:05 /dev/virtual_nci

---
 drivers/nfc/virtual_ncidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/virtual_ncidev.c +0 -0
index 221fa3bb8705..f577449e4935 100644

--- a/drivers/nfc/virtual_ncidev.c

drivers/nfc/virtual_ncidev.c static int __init virtual_ncidev_init(void) · line 208

Quoted 11 lines

+++ b/drivers/nfc/virtual_ncidev.c

drivers/nfc/virtual_ncidev.c +1 -1
@@ -202,7 +202,7 @@ static int __init virtual_ncidev_init(void)
 	 miscdev.minor = MISC_DYNAMIC_MINOR;
 	 miscdev.name = "virtual_nci";
 	 miscdev.fops = &virtual_ncidev_fops;
-	 miscdev.mode = S_IALLUGO;
+	 miscdev.mode = 0600;
 
 	 return misc_register(&miscdev);
 }

Thanks.

#3 lore raw
In reply to Thadeu Lima de Souza Cascardo
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 25 Nov 2021 11:14:57 -0300 you wrote:

Device permissions is S_IALLUGO, with many unnecessary bits. Remove them and also remove read and write permissions from group and others.

Before the change:
crwsrwsrwt 1 0 0 10, 125 Nov 25 13:59 /dev/virtual_nci

After the change:
crw------- 1 0 0 10, 125 Nov 25 14:05 /dev/virtual_nci

[...]

Here is the summary with links:
- nfc: virtual_ncidev: change default device permissions

    https://git.kernel.org/netdev/net/c/c26381f97e2a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html