Skip to content

Commit 0c57aa8

Browse files
Dan Carpentergregkh
authored andcommitted
wifi: ath12k: Fix buffer overflow in debugfs
[ Upstream commit 8c7a503 ] 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: 3f73c24 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 827ff61 commit 0c57aa8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,9 @@ static ssize_t ath12k_write_htt_stats_type(struct file *file,
16461646
const int size = 32;
16471647
int num_args;
16481648

1649+
if (count > size)
1650+
return -EINVAL;
1651+
16491652
char *buf __free(kfree) = kzalloc(size, GFP_KERNEL);
16501653
if (!buf)
16511654
return -ENOMEM;

0 commit comments

Comments
 (0)