2024-03-05 15:14:32

by Jeff Johnson

[permalink] [raw]
Subject: [PATCH] wifi: ath11k: fix soc_dp_stats debugfs file permission

Currently the soc_dp_stats debugfs file has the following permissions:

# ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
-rw------- 1 root root 0 Mar 4 15:04 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats

However this file does not actually support write operations -- no .write()
method is registered. Therefore use the correct permissions when creating
the file.

After the change:

# ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
-r-------- 1 root root 0 Mar 4 15:15 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30

Signed-off-by: Jeff Johnson <[email protected]>
---
drivers/net/wireless/ath/ath11k/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c
index a48e737ef35d..414a5ce279f7 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include <linux/vmalloc.h>
@@ -980,7 +980,7 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab)
debugfs_create_file("simulate_fw_crash", 0600, ab->debugfs_soc, ab,
&fops_simulate_fw_crash);

- debugfs_create_file("soc_dp_stats", 0600, ab->debugfs_soc, ab,
+ debugfs_create_file("soc_dp_stats", 0400, ab->debugfs_soc, ab,
&fops_soc_dp_stats);

if (ab->hw_params.sram_dump.start != 0)

---
base-commit: 776c9c93bb0511d04e6222546499e5ea20ad51b0
change-id: 20240304-fix-soc_dp_stats-permission-4d387cc29c4a



2024-03-08 15:06:14

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath11k: fix soc_dp_stats debugfs file permission

Jeff Johnson <[email protected]> wrote:

> Currently the soc_dp_stats debugfs file has the following permissions:
>
> # ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
> -rw------- 1 root root 0 Mar 4 15:04 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
>
> However this file does not actually support write operations -- no .write()
> method is registered. Therefore use the correct permissions when creating
> the file.
>
> After the change:
>
> # ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
> -r-------- 1 root root 0 Mar 4 15:15 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
>
> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
>
> Signed-off-by: Jeff Johnson <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

fa645e663165 wifi: ath11k: fix soc_dp_stats debugfs file permission

--
https://patchwork.kernel.org/project/linux-wireless/patch/20240305-fix-soc_dp_stats-permission-v1-1-2ec10b42f755@quicinc.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches