mt76: mt7615: fix a precision vs width bug in printk
Subsystems (3)
PATCH 1/3 mt76: mt7615: fix a precision vs width bug in printk
Precision "%.*s" was intended instead of width "%*s". The original code will print garbage from beyond the end of the skb->data.
--- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +1 -1
@@ -424,7 +424,7 @@ mt7615_mcu_rx_log_message(struct mt7615_dev *dev, struct sk_buff *skb)break ; } -wiphy_info (mt76_hw (dev)->wiphy,"%s: %*s" , type, +wiphy_info (mt76_hw (dev)->wiphy,"%s: %.*s" , type, (int )(skb->len -sizeof (*rxd)), data); }
Signature · 7 lines
2.30.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH 2/3 mt76: mt7915: fix a precision vs width bug in printk
Precision %.*s was intended instead of width %.*s. The original code will still print unintended data from beyond the end of skb->data.
--- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +1 -1
@@ -521,7 +521,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)break ; } -wiphy_info (mt76_hw (dev)->wiphy,"%s: %*s" , type, +wiphy_info (mt76_hw (dev)->wiphy,"%s: %.*s" , type, (int )(skb->len -sizeof (*rxd)), data); }
Signature · 7 lines
2.30.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH 2/3] mt76: mt7915: fix a precision vs width bug in printk
Quoted 2 lines · Dan Carpenter
Precision %.*s was intended instead of width %.*s.
typo there, the second instance should say "width %*s" :-)
johannes
Re: [PATCH 2/3] mt76: mt7915: fix a precision vs width bug in printk
Quoted 5 lines · Johannes Berg
Quoted 2 lines · Dan Carpenter
Precision %.*s was intended instead of width %.*s.
typo there, the second instance should say "width %*s" :-)
The hunter has become the hunted. *dramatic music. dah dah dah.*
:P
Thanks.
regards,
dan carpenter
PATCH v2 2/3 mt76: mt7915: fix a precision vs width bug in printk
In reply to Johannes BergPrecision %.*s was intended instead of width %*s. The original code will still print unintended data from beyond the end of skb->data.
---
v2: fix a typo in the commit message
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +1 -1
@@ -521,7 +521,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)break ; } -wiphy_info (mt76_hw (dev)->wiphy,"%s: %*s" , type, +wiphy_info (mt76_hw (dev)->wiphy,"%s: %.*s" , type, (int )(skb->len -sizeof (*rxd)), data); }
Signature · 1 line
2.30.2
PATCH 3/3 mt76: mt7921: fix a precision vs width bug in printk
In reply to Dan CarpenterPrecision %.*s was intended instead of width %*s. The original code is potentially an information leak.
--- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +1 -1
@@ -500,7 +500,7 @@ mt7921_mcu_debug_msg_event(struct mt7921_dev *dev, struct sk_buff *skb)if (!msg->content[i]) msg->content[i] =' ' ; } -wiphy_info (mt76_hw (dev)->wiphy,"%*s" , len, msg->content); +wiphy_info (mt76_hw (dev)->wiphy,"%.*s" , len, msg->content); } }
Signature · 7 lines
2.30.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek