This is a note to let you know that I've just added the patch titled mac80211: fix ht_capa printout in debugfs to the 5.17-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mac80211-fix-ht_capa-printout-in-debugfs.patch and it can be found in the queue-5.17 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit c9d9e99efa386fd0b1571a65a1fb92397b4064dc Author: Ben Greear <greearb@xxxxxxxxxxxxxxx> Date: Wed Apr 6 10:56:59 2022 -0700 mac80211: fix ht_capa printout in debugfs [ Upstream commit fb4bccd863ccccd36ad000601856609e259a1859 ] Don't use sizeof(pointer) when calculating scnprintf offset. Fixes: 01f84f0ed3b4 ("mac80211: reduce stack usage in debugfs") Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20220406175659.20611-1-greearb@xxxxxxxxxxxxxxx [correct the Fixes tag] Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 9479f2787ea7..88d9cc945a21 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -441,7 +441,7 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, #define PRINT_HT_CAP(_cond, _str) \ do { \ if (_cond) \ - p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ + p += scnprintf(p, bufsz + buf - p, "\t" _str "\n"); \ } while (0) char *buf, *p; int i;