diff mbox series

mt76: mt7915: fix info leak in mt7915_mcu_set_pre_cal()

Message ID YNXvLvrvllpXgCIn@mwanda (mailing list archive)
State Accepted
Delegated to: Felix Fietkau
Headers show
Series mt76: mt7915: fix info leak in mt7915_mcu_set_pre_cal() | expand

Commit Message

Dan Carpenter June 25, 2021, 2:58 p.m. UTC
Zero out all the unused members of "req" so that we don't disclose
stack information.

Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo June 26, 2021, 9:43 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> Zero out all the unused members of "req" so that we don't disclose
> stack information.
>
> Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Felix, should I take this directly to wireless-drivers? If yes, please
ack.
Felix Fietkau June 26, 2021, 11:42 a.m. UTC | #2
On 2021-06-25 16:58, Dan Carpenter wrote:
> Zero out all the unused members of "req" so that we don't disclose
> stack information.
> 
> Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Felix Fietkau <nbd@nbd.name>
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 863aa18b3024..21769e4f6bc7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -3481,7 +3481,7 @@  static int mt7915_mcu_set_pre_cal(struct mt7915_dev *dev, u8 idx,
 		u8 idx;
 		u8 rsv[4];
 		__le32 len;
-	} req;
+	} req = {};
 	struct sk_buff *skb;
 
 	skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, sizeof(req) + len);