From: Jeff Johnson <quic_jjohnson@quicinc.com>
To: "Felix Fietkau" <nbd@nbd.name>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"Johannes Berg" <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Michael Braun" <michael-dev@fami-braun.de>
Cc: Harsh Kumar Bijlani <hbijlani@qti.qualcomm.com>,
Kalyan Tallapragada <ktallapr@qti.qualcomm.com>,
Jyothi Chukkapalli <jchukkap@qti.qualcomm.com>,
Anirban Sirkhell <anirban@qti.qualcomm.com>,
Johannes Berg <johannes.berg@intel.com>,
<linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <ath12k@lists.infradead.org>
Subject: Re: [PATCH] wifi: mac80211: Fix ieee80211_convert_to_unicast() logic
Date: Fri, 16 Aug 2024 13:04:57 -0700 [thread overview]
Message-ID: <a4167f39-b2e5-4b86-b85f-a1dad4669fec@quicinc.com> (raw)
In-Reply-To: <e7435c73-1d01-40e8-82b3-4e5456fccf2f@nbd.name>
On 8/16/2024 10:54 AM, Felix Fietkau wrote:
> On 16.08.24 16:30, Jeff Johnson wrote:
>> On 8/16/2024 4:31 AM, Toke Høiland-Jørgensen wrote:
>>> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
>>>
>>>> The current logic in ieee80211_convert_to_unicast() uses skb_clone()
>>>> to obtain an skb for each individual destination of a multicast
>>>> frame, and then updates the destination address in the cloned skb's
>>>> data buffer before placing that skb on the provided queue.
>>>>
>>>> This logic is flawed since skb_clone() shares the same data buffer
>>>> with the original and the cloned skb, and hence each time the
>>>> destination address is updated, it overwrites the previous destination
>>>> address in this shared buffer. As a result, due to the special handing
>>>> of the first valid destination, all of the skbs will eventually be
>>>> sent to that first destination.
>>>
>>> Did you actually observe this happen in practice? ieee80211_change_da()
>>> does an skb_ensure_writable() check on the Ethernet header before
>>> writing it, so AFAICT it does not, in fact, overwrite the data of the
>>> original frame.
>>
>> I'm proxying this change for our internal team, and they have observed that
>> unicast frames are not being sent to the separate STAs.
>>
>> In response to your reply I went through the code again and it seems the
>> manner in which this functionality fails isn't as it was described to me.
>>
>> Instead this functionality fails because we'd fail on the first
>> ieee80211_change_da() call and hence goto multicast and where only the
>> original skb would be queued and transmitted as a multicast frame
>>
>> So the original logic is still faulty, only the actual faulty behavior is not
>> being described correctly: instead of sending multiple unicast frames to the
>> same STA we'd send a single multicast frame.
>
> While I agree with switching over to skb_copy (or maybe pskb_copy to
> reduce realloc on fragmented skbs), it's still not clear to me why
> ieee80211_change_da fails. It should detect that the packet was cloned,
> letting pskb_expand_head reallocate the head of the skb.
>
> Please run some more tests to figure out the exact reason for the
> failure. There might be another hidden bug lurking there, which would
> get papered over by this change.
>
> - Felix
Thanks, I've thrown this back over to the development team to clarify.
/jeff
prev parent reply other threads:[~2024-08-16 20:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 16:18 Jeff Johnson
2024-08-16 11:31 ` Toke Høiland-Jørgensen
2024-08-16 14:30 ` Jeff Johnson
2024-08-16 17:54 ` Felix Fietkau
2024-08-16 20:04 ` Jeff Johnson [this message]
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=a4167f39-b2e5-4b86-b85f-a1dad4669fec@quicinc.com \
--to=quic_jjohnson@quicinc.com \
--cc=anirban@qti.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hbijlani@qti.qualcomm.com \
--cc=jchukkap@qti.qualcomm.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=ktallapr@qti.qualcomm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michael-dev@fami-braun.de \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=toke@redhat.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®