diff options
author | Sven Eckelmann <sven@narfation.org> | 2020-11-24 18:59:16 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-12-02 21:19:06 +0300 |
commit | d35d1375493b0f962a5da5aef015b8bd215e059d (patch) | |
tree | f026d536a49174e36354106372cdb5ed875a9d2a /drivers/net/wireless | |
parent | 5da7acfec5ec55aa0b69b8760f1d2116b4e2ad26 (diff) | |
download | linux-d35d1375493b0f962a5da5aef015b8bd215e059d.tar.xz |
ath11k: Build check size of ath11k_skb_cb
It is rather easy to add more entries to ath11k_skb_cb while forgetting the
size limit of ieee80211_tx_info->driver_data. So just check this during the
build to reduce the change of accidental buffer overflow in the skbuff->cb.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201119154235.263250-3-sven@narfation.org
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath11k/core.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 25609ff300a5..317b15e333d3 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -909,6 +909,8 @@ static inline const char *ath11k_scan_state_str(enum ath11k_scan_state state) static inline struct ath11k_skb_cb *ATH11K_SKB_CB(struct sk_buff *skb) { + BUILD_BUG_ON(sizeof(struct ath11k_skb_cb) > + IEEE80211_TX_INFO_DRIVER_DATA_SIZE); return (struct ath11k_skb_cb *)&IEEE80211_SKB_CB(skb)->driver_data; } |