Skip to content

Commit

Permalink
ath11k: Build check size of ath11k_skb_cb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sven Eckelmann authored and Kalle Valo committed Dec 2, 2020
1 parent 5da7acf commit d35d137
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath11k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d35d137

Please sign in to comment.