mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eugene Markus <eugene@fiftyone-percent.net>
To: Sandeep Haemoon <sandeeph@loljews.com>, netdev@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Russell King <linux@armlinux.org.uk>,
	Daniel Golle <daniel@makrotopia.org>,
	Mason Chang <mason-cw.chang@mediatek.com>,
	Frank Wunderlich <frank-w@public-files.de>,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v7 1/3] net: ethernet: mtk_eth_soc: fix the RX
Date: Sat, 28 Nov 2026 19:34:01 +1100	[thread overview]
Message-ID: <17e86b6f-25af-43fc-b0ca-a0eb982e6cf4@fiftyone-percent.net> (raw)
In-Reply-To: <patch-295a65477d87017ff5b65482ffae46fb@loljews.com>


On Sat, 14 Nov 2026 00:34:14 +0200, Sandeep Haemoon wrote:
 > Reset dma_addr to DMA_MAPPING_ERROR at the start of every iteration,
 > so a descriptor that is released without a new mapping keeps its own
 > address bits.

This bug is not theoretical: it has been corrupting memory in the field
on a BPI-R4 Pro 8X (MT7988A, 8 GiB) running OpenWrt main (r38441,
kernel 6.18.60) as a home router with a Bitcoin node behind it. We
arrived at the same one-line fix independently before finding this
series, and have tested it on that board.

You wrote on 22 Nov that the issue fixed in 1/3 came from automated
review and had not been triggered at runtime. On this board it is
triggered, through the refill allocation failure path, as below.

Symptoms, five times, between 8 minutes and 2 h 47 min into a sync with
the node's peers on the WAN port (the GMAC's own port, not DSA):
  - "BUG: Bad page map" in the node's process, then "Unable to handle
    kernel paging request" in unmap_page_range() and a panic;
  - "get_swap_device: Bad swap file entry" with no swap configured;
  - LevelDB "block checksum mismatch" on files intact on disk.
The corrupted pages held a received WAN frame starting at byte 256
(MTK_PP_HEADROOM): a page-table page had the board's WAN MAC followed by
the gateway's MAC at entry 32, and a LevelDB page in the page cache held
a complete IPv4/TCP frame from a peer's port 8333. The trigger is a
page_pool allocation failure: the page cache fills the 8 GiB and free
memory sat at 60-120 MB.

Bench test, RAM-booted kernel with PAGE_TABLE_CHECK, DEBUG_PAGEALLOC
and KFENCE; a test-only switch making every Nth RX refill fail (standing
in for a page_pool failure) and another restoring the old dma_addr
handling; a user process holding 6000 MB with a known pattern that
reports every changed page with its physical address (pagemap); TCP
into the GMAC at line rate:

   dma_addr handling   refills released with   pages changed
                       another buffer's bits
   old, run 1          166                     70, each a WAN frame
                                               at byte 256
   old, run 2          11                      4, each at exactly the
                                               address the driver
                                               computed (e.g. frame to
                                               0x1613cf100, page
                                               0x1613cf000 changed in
                                               bytes 256..1775)
   this patch          0 (59,817 and 45,274    0
                       would have been)

The other misdirected frames pointed below 0x40000000, where this SoC
has no RAM but has device registers and PCIe windows. No kernel errors
were logged in any phase: the debug options cannot see a device write.

On the board itself, the node then synced 57,736 blocks (about 6 hours
of continuous peer traffic) with this patch and no corruption; the build
before it, without the patch, corrupted after 2 h 47 min.

As this is silent memory corruption with network-supplied contents on
shipping MT7988 boards with more than 4 GiB, could 1/3 go to net on its
own, with Cc: stable, ahead of the jumbo frame work?

The analysis of the corrupted pages, the driver reading and the bench
tests were done with an AI coding assistant (Claude Code); I ran them on
my board and have checked the results.

Tested-by: Eugene Markus <eugene@fiftyone-percent.net>

  parent reply	other threads:[~2026-11-28  8:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 19:55 [PATCH net-next v7 0/3] net: ethernet: mtk_eth_soc: 9K jumbo frame support Sandeep Haemoon
2026-11-13 22:34 ` [PATCH net-next v7 1/3] net: ethernet: mtk_eth_soc: fix the RX Sandeep Haemoon
2026-11-21 20:21   ` netdev-bot+sashiko
2026-11-28  8:34   ` Eugene Markus [this message]
2026-11-30 23:16     ` Sandeep Haemoon
2026-11-13 22:34 ` [PATCH net-next v7 2/3] net: ethernet: mtk_eth_soc: skip page_pool Sandeep Haemoon
2026-11-21 20:22   ` netdev-bot+sashiko
2026-11-13 22:40 ` [PATCH net-next v7 3/3] net: ethernet: mtk_eth_soc: add 9K jumbo Sandeep Haemoon
2026-11-21 20:22   ` netdev-bot+sashiko
2026-11-17 19:57 ` [PATCH net-next v7 0/3] net: ethernet: mtk_eth_soc: 9K jumbo frame support netdev-bot+sinfo
2026-11-22  0:47 ` Jakub Kicinski

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=17e86b6f-25af-43fc-b0ca-a0eb982e6cf4@fiftyone-percent.net \
    --to=eugene@fiftyone-percent.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=frank-w@public-files.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo@kernel.org \
    --cc=mason-cw.chang@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sandeeph@loljews.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®