]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: Fix hwstats debugfs file permissions
authorIdo Schimmel <idosch@nvidia.com>
Fri, 9 Sep 2022 15:38:30 +0000 (18:38 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 19 Sep 2022 21:40:38 +0000 (14:40 -0700)
commitdd9c00e68202458f068d3576ad0d14ac5d785950
treeb6195932f437ab950219e1e7e23e86173f8bf0aa
parent6d70f247d96514631286d29d97b5950f8f094594
netdevsim: Fix hwstats debugfs file permissions

The hwstats debugfs files are only writeable, but they are created with
read and write permissions, causing certain selftests to fail [1].

Fix by creating the files with write permission only.

[1]
 # ./test_offload.py
 Test destruction of generic XDP...
 Traceback (most recent call last):
   File "/home/idosch/code/linux/tools/testing/selftests/bpf/./test_offload.py", line 810, in <module>
     simdev = NetdevSimDev()
 [...]
 Exception: Command failed: cat /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex

 cat: /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex: Invalid argument

Fixes: 3360a2445c8c ("netdevsim: Introduce support for L3 offload xstats")
Reported-by: Jie2x Zhou <jie2x.zhou@intel.com>
Tested-by: Jie2x Zhou <jie2x.zhou@intel.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/20220909153830.3732504-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/hwstats.c