From: Ryder Lee <ryder.lee@mediatek.com> Date: 2021-07-31 02:17:37
From: Ben Greear <redacted>
Without this change, garbage is seen in the hwmon name
and sensors output for mt7915 is garbled.
With the change:
mt7915-pci-1400
Adapter: PCI adapter
temp1: +49.0°C
Fixes: d6938251bb5b (mt76: mt7915: add thermal sensor device support)
Signed-off-by: Ben Greear <redacted>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
v4: Simplify flow.
v3: Add 'fixes' tag to aid backports.
---
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
From: Ryder Lee <ryder.lee@mediatek.com> Date: 2021-07-31 02:17:38
Without this change, garbage is seen in the hwmon name
and sensors output for mt7615 is garbled.
Fixes: 109e505ad944 (mt76: mt7615: add thermal sensor device support)
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7615/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Felix Fietkau <nbd@nbd.name> Date: 2021-08-13 10:15:16
On 2021-07-31 04:17, Ryder Lee wrote:
From: Ben Greear <redacted>
Without this change, garbage is seen in the hwmon name
and sensors output for mt7915 is garbled.
Where does the use-after-free bug come from? It's not obvious to me why
using KBUILD_MODNAME instead of wiphy_name() fixes it.
I still think the phy name should probably be part of the prefix.
With the change:
mt7915-pci-1400
Adapter: PCI adapter
temp1: +49.0°C
Fixes: d6938251bb5b (mt76: mt7915: add thermal sensor device support)
The format is wrong (missing quotes), and the hash references a commit
that's not in any upstream tree.
- Felix
From: Ben Greear <hidden> Date: 2021-08-13 13:54:47
On 8/13/21 3:15 AM, Felix Fietkau wrote:
On 2021-07-31 04:17, Ryder Lee wrote:
quoted
From: Ben Greear <redacted>
Without this change, garbage is seen in the hwmon name
and sensors output for mt7915 is garbled.
Where does the use-after-free bug come from? It's not obvious to me why
using KBUILD_MODNAME instead of wiphy_name() fixes it.
I still think the phy name should probably be part of the prefix.
We rename phy devices as part of our normal operation, I think maybe
that helps trigger the bug.
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. But,
I did not actually verify that.
Thanks,
Ben
quoted
With the change:
mt7915-pci-1400
Adapter: PCI adapter
temp1: +49.0°C
Fixes: d6938251bb5b (mt76: mt7915: add thermal sensor device support)
The format is wrong (missing quotes), and the hash references a commit
that's not in any upstream tree.
- Felix
From: Felix Fietkau <nbd@nbd.name> Date: 2021-08-13 14:08:52
On 2021-08-13 15:54, Ben Greear wrote:
On 8/13/21 3:15 AM, Felix Fietkau wrote:
quoted
On 2021-07-31 04:17, Ryder Lee wrote:
quoted
From: Ben Greear <redacted>
Without this change, garbage is seen in the hwmon name
and sensors output for mt7915 is garbled.
Where does the use-after-free bug come from? It's not obvious to me why
using KBUILD_MODNAME instead of wiphy_name() fixes it.
I still think the phy name should probably be part of the prefix.
We rename phy devices as part of our normal operation, I think maybe
that helps trigger the bug.
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. But,
I did not actually verify that.
That makes sense. It seems that thermal copies the string internally,
but hwmon does not.
How about using devm_kstrdup on the wiphy name instead of using
KBUILD_MODNAME? If you really don't want to use the initial phy name,
there's also the option of using dev_name(dev->mt76.dev)
- Felix