All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luka Gejak" <luka.gejak@linux.dev>
To: "Matthew Leach" <matthew.leach@collabora.com>,
	"Luka Gejak" <luka.gejak@linux.dev>
Cc: "Bob Beckett" <bob.beckett@collabora.com>,
	"Ping-Ke Shih" <pkshih@realtek.com>,
	<linux-wireless@vger.kernel.org>, <kernel@collabora.com>
Subject: Re: rtw88: 8822CE passes corrupted A-MSDUs as hw-decrypted, poisoning CCMP replay counter
Date: Mon, 19 Oct 2026 16:30:44 +0000	[thread overview]
Message-ID: <DM8YI0GAO2B6.235M23CNMOOA2@linux.dev> (raw)
In-Reply-To: <87wlrdc13e.fsf@collabora.com>

Hi Matthew,

On Mon Oct 19, 2026 at 12:43 PM UTC, Matthew Leach wrote:
> The fresh header followed by unexpected contents is consistent with an
> incomplete write, although I don't think we can distinguish that from
> consuming the buffer before all payload writes are visible. Could we
> compare the RX buffer contents when completion is first observed and
> again before returning the buffer to the hardware? If the contents
> change while the buffer is still host-owned, that would support
> premature completion signalling.

Good idea, but Bob's report says the RX buffers go through SWIOTLB, so
skb->data only gets updated when we call dma_sync_single_for_cpu(). A
late write would stay in the bounce slot and you would never see it
change. The second read needs another dma_sync_single_for_cpu() before
comparing, so doing it only for frames that fail the CCMP header check
keeps it cheap. A run with the IOMMU on would be worth trying too.

The old descriptor in drv_info could also be leftover data from the
device's RX FIFO, which would fit Bob's idea as well.

> However, all four captured bad frames have ICV_ERR clear, so
> checking that bit alone would not catch these examples.

Right, the ICV part doesn't help here, it's only there to match rtw89.
I'll make that clear in v2.

> However, jump 3 has valid reserved/ExtIV bytes (44 50 00 20) and
> corruption in the remaining PN bytes, so this patch would retain
> RX_FLAG_DECRYPTED and still poison the replay counter.

Agreed, it only narrows it. Checking for the LLC/SNAP header after the
first A-MSDU subframe header would catch frame 3 too, but that's a
guess about the payload. I'd rather see what the test shows first,
since that tells us if the fix belongs in the driver or in the device.

Best regards,
Luka Gejak

      reply	other threads:[~2026-10-19 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 19:11 rtw88: 8822CE passes corrupted A-MSDUs as hw-decrypted, poisoning CCMP replay counter Bob Beckett
2026-10-16 22:15 ` Luka Gejak
2026-10-17  8:36   ` Luka Gejak
2026-10-19 12:43   ` Matthew Leach
2026-10-19 16:30     ` Luka Gejak [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=DM8YI0GAO2B6.235M23CNMOOA2@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=bob.beckett@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=matthew.leach@collabora.com \
    --cc=pkshih@realtek.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 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.