diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-04-09 14:01:25 +0300 |
---|---|---|
committer | Jeff Johnson <jeff.johnson@oss.qualcomm.com> | 2025-04-12 07:19:29 +0300 |
commit | 8c7a5031a6b0d42e640fbd2d5d05f61f74e32dce (patch) | |
tree | 2e4ca33911b80f8ea30bbc7ac171aae6d8818403 | |
parent | 4703416d0fb993f7505025667f868f6981a5f7ab (diff) | |
download | linux-8c7a5031a6b0d42e640fbd2d5d05f61f74e32dce.tar.xz |
wifi: ath12k: Fix buffer overflow in debugfs
If the user tries to write more than 32 bytes then it results in memory
corruption. Fortunately, this is debugfs so it's limited to root users.
Fixes: 3f73c24f28b3 ("wifi: ath12k: Add support to enable debugfs_htt_stats")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/35daefbd-d493-41d9-b192-96177d521b40@stanley.mountain
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c index 1c0d5fa39a8d..aeaf970339d4 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c @@ -5377,6 +5377,9 @@ static ssize_t ath12k_write_htt_stats_type(struct file *file, const int size = 32; int num_args; + if (count > size) + return -EINVAL; + char *buf __free(kfree) = kzalloc(size, GFP_KERNEL); if (!buf) return -ENOMEM; |