Skip to contentSkip to conversation

staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.

PATCH Superseded Malcolm Priestley 2 participants 4 messages Feb 2, 2020 – Feb 4, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.

bb_pre_ed_rssi is an u8 rx_dm always returns negative signed values add minus operator to always yield positive.

fixes issue where rx sensitivity is always set to maximum because the unsigned numbers were always greater then 100.

---
 drivers/staging/vt6656/dpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/dpc.c +1 -1
index 821aae8ca402..a0b60e7d1086 100644
@@ -98,7 +98,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
 
 	vnt_rf_rssi_to_dbm(priv, tail->rssi, &rx_dbm);
 
-	priv->bb_pre_ed_rssi = (u8)rx_dbm + 1;
+	priv->bb_pre_ed_rssi = (u8)-rx_dbm + 1;
 	priv->current_rssi = priv->bb_pre_ed_rssi;
 
 	skb_pull(skb, sizeof(*head));
Signature · 1 line
2.25.0
#1 lore raw
Quoted 7 lines · Malcolm Priestley

bb_pre_ed_rssi is an u8 rx_dm always returns negative signed values add minus operator to always yield positive.

fixes issue where rx sensitivity is always set to maximum because the unsigned numbers were always greater then 100.

Cc stable <[email protected]>

Can you add a Fixes tag for stable kernels?

Fixes 63b9907f58f1 ("staging: vt6656: mac80211 conversion: create rx function.")

Otherwise we don't backport it far enough and then it becomes an actively exploited Android vulnerability and Google writes an article about it. Then everyone gets annoyed with us and shakes their head because OpenBSD never has Android vulnerabilities etc...

Quoted 3 lines
---
 drivers/staging/vt6656/dpc.c | 2 +-

It appears that the vt6655 driver has the same issue.

regards,
dan carpenter

#2 lore raw

PATCH v2 1/2 staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.

bb_pre_ed_rssi is an u8 rx_dm always returns negative signed values add minus operator to always yield positive.

fixes issue where rx sensitivity is always set to maximum because the unsigned numbers were always greater then 100.

Fixes 63b9907f58f1 ("staging: vt6656: mac80211 conversion: create rx function.")
Cc stable <[email protected]>

---
Added fixes tag

 drivers/staging/vt6656/dpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/dpc.c +1 -1
index 821aae8ca402..a0b60e7d1086 100644
@@ -98,7 +98,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
 
 	vnt_rf_rssi_to_dbm(priv, tail->rssi, &rx_dbm);
 
-	priv->bb_pre_ed_rssi = (u8)rx_dbm + 1;
+	priv->bb_pre_ed_rssi = (u8)-rx_dbm + 1;
 	priv->current_rssi = priv->bb_pre_ed_rssi;
 
 	skb_pull(skb, sizeof(*head));
Signature · 1 line
2.25.0
#3 lore raw
In reply to Dan Carpenter
Quoted 9 lines · Dan Carpenter
Quoted 8 lines · Malcolm Priestley

bb_pre_ed_rssi is an u8 rx_dm always returns negative signed values add minus operator to always yield positive.

fixes issue where rx sensitivity is always set to maximum because the unsigned numbers were always greater then 100.

Cc stable <[email protected]>

---

...

Quoted 3 lines
Quoted 1 line
 drivers/staging/vt6656/dpc.c | 2 +-

It appears that the vt6655 driver has the same issue.

In the vt6655 it is not used.

Regards

Malcolm