staging: wfx: fix potential vulnerability to spectre
PATCH v2 1/1 staging: wfx: fix potential vulnerability to spectre
From: Jérôme Pouiller <[email protected]>
array_index_nospec() should be applied after a bound check.
Fixes 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by kbuild test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Jérôme Pouiller <[email protected]>
---
v2: cut down commit-id to 12 characters
drivers/staging/wfx/wfx.h | 1 + 1 file changed, 1 insertion(+)
drivers/staging/wfx/wfx.h +1 -0
@@ -138,6 +138,7 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)dev_dbg (wdev->dev,"requesting non-existent vif: %d\n" , vif_id);return NULL ; } + vif_id =array_index_nospec (vif_id,ARRAY_SIZE (wdev->vif));if (!wdev->vif[vif_id]) {dev_dbg (wdev->dev,"requesting non-allocated vif: %d\n" , vif_id);return NULL ;
Signature · 1 line
2.20.1