Re: [PATCH 39/64] mac80211: Use memset_after() to clear tx status
From: Johannes Berg
Date: Fri Aug 13 2021 - 03:42:07 EST
On Sat, 2021-07-31 at 08:55 -0700, Kees Cook wrote:
>
> > @@ -278,9 +278,7 @@ static void carl9170_tx_release(struct kref *ref)
> > 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));
> > + memset_after(&txinfo->status, 0, rates);
FWIW, I think we should also remove the BUILD_BUG_ON() now in all the
places - that was meant to give people a hint to update if some field
ordering etc. changed, but now that it's "after rates" this is no longer
necessary.
johannes