From: Sven Eckelmann <sven@narfation.org> To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Sven Eckelmann <sven@narfation.org> Subject: [PATCH v2 3/3] ath11k: Build check size of ath11k_skb_cb Date: Thu, 19 Nov 2020 16:42:34 +0100 [thread overview] Message-ID: <20201119154235.263250-3-sven@narfation.org> (raw) In-Reply-To: <20201119154235.263250-1-sven@narfation.org> 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> --- v2: - new patch drivers/net/wireless/ath/ath11k/core.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 5a7915f75e1e..b5ca4455b2e0 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; } -- 2.29.2
WARNING: multiple messages have this Message-ID (diff)
From: Sven Eckelmann <sven@narfation.org> To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Sven Eckelmann <sven@narfation.org> Subject: [PATCH v2 3/3] ath11k: Build check size of ath11k_skb_cb Date: Thu, 19 Nov 2020 16:42:34 +0100 [thread overview] Message-ID: <20201119154235.263250-3-sven@narfation.org> (raw) In-Reply-To: <20201119154235.263250-1-sven@narfation.org> 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> --- v2: - new patch drivers/net/wireless/ath/ath11k/core.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 5a7915f75e1e..b5ca4455b2e0 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; } -- 2.29.2 -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2020-11-19 15:43 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-19 15:42 [PATCH v2 1/3] ath11k: Don't cast ath11k_skb_cb to ieee80211_tx_info.control Sven Eckelmann 2020-11-19 15:42 ` Sven Eckelmann 2020-11-19 15:42 ` [PATCH v2 2/3] ath11k: Reset ath11k_skb_cb before setting new flags Sven Eckelmann 2020-11-19 15:42 ` Sven Eckelmann 2020-11-19 15:42 ` Sven Eckelmann [this message] 2020-11-19 15:42 ` [PATCH v2 3/3] ath11k: Build check size of ath11k_skb_cb Sven Eckelmann 2020-12-02 18:19 ` [PATCH v2 1/3] ath11k: Don't cast ath11k_skb_cb to ieee80211_tx_info.control Kalle Valo 2020-12-02 18:19 ` Kalle Valo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201119154235.263250-3-sven@narfation.org \ --to=sven@narfation.org \ --cc=ath11k@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.