mt76: mt7915: fix hwmon temp sensor mem use-after-free
authorBen Greear <greearb@candelatech.com>
Thu, 2 Sep 2021 05:52:03 +0000 (13:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:37 +0000 (19:16 +0100)
commit32ec365cdca6357dc30620565531ed7f3933bfa1
treed3d93043e9c1d12a7a89a97b127e2989c770414a
parent2c9e98bca4a5aa4119231e3a7fa7154179518cbe
mt76: mt7915: fix hwmon temp sensor mem use-after-free

[ Upstream commit 0ae3ff5684514d72357240f1033a7494c51f93ed ]

Without this change, garbage is seen in the hwmon name and sensors output
for mt7915 is garbled. It appears that the hwmon logic does not make a
copy of the incoming string, but instead just copies a char* and expects
it to never go away.

Fixes: 33fe9c639c13 ("mt76: mt7915: add thermal sensor device support")
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/init.c