Thread (108 messages) 108 messages, 22 authors, 2021-11-24

Re: [PATCH v2 44/63] mac80211: Use memset_after() to clear tx status

From: Kees Cook <hidden>
Date: 2021-08-18 09:05:52
Also in: dri-devel, linux-hardening, linux-kbuild, linux-staging, linux-wireless, lkml, netdev

On Wed, Aug 18, 2021 at 10:06:51AM +0200, Johannes Berg wrote:
On Wed, 2021-08-18 at 09:08 +0200, Johannes Berg wrote:
quoted
On Tue, 2021-08-17 at 23:05 -0700, Kees Cook wrote:
quoted
@@ -275,12 +275,11 @@ static void carl9170_tx_release(struct kref *ref)
 	if (WARN_ON_ONCE(!ar))
 		return;
 



-	BUILD_BUG_ON(
-	    offsetof(struct ieee80211_tx_info, status.ack_signal) != 20);
-
-	memset(&txinfo->status.ack_signal, 0,
-	       sizeof(struct ieee80211_tx_info) -
-	       offsetof(struct ieee80211_tx_info, status.ack_signal));
+	/*
+	 * Should this call ieee80211_tx_info_clear_status() instead of clearing
+	 * manually? txinfo->status.rates do not seem to be used here.
+	 */
Since you insist, I went digging :)

It should not, carl9170_tx_fill_rateinfo() has filled the rate
information before we get to this point.
Ah-ha! Thanks for checking. I'll update the comment to explain the
rationale here.
Otherwise, looks fine, FWIW.
Thanks!
Are you going to apply all of these together somewhere? I (we) can't,
since memset_after() doesn't exist yet.
Right, given the dependencies, I am expecting to just carry the whole
series, since the vast majority of it has no binary changes, etc. I'm
hoping to get it into -next soon, but we're uncomfortably close to the
merge window. :P

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help