Re: [PATCH net] e1000e: Fix out-of-bounds MMIO access by validating BAR0 size
From: Pu Lehui
Date: Mon Jul 20 2026 - 09:19:55 EST
On 2026/7/20 20:53, Breno Leitao wrote:
On Mon, Jul 20, 2026 at 07:56:20PM +0800, Pu Lehui wrote:
On 2026/7/20 17:47, Breno Leitao wrote:
On Wed, Jul 15, 2026 at 03:58:50AM +0000, Pu Lehui wrote:
+/* Minimum MMIO (BAR0) len, the largest offset is lower than 64K */
Why "the largest" in this case?
Hi Breno,
Thanks for pointing that out. I meant the maximum register offset accessed
by the driver.
IIUC, common e1000e NIC usually have a 128K BAR0. But since I'm not 100%
sure if older NIC might be smaller, I picked 64K as a safe lower limit
because it covers the largest register offset used in the driver's codebase.
If my assumption here is off, I'd really appreciate any corrections!
And for this comment, how about the follow?
/* Minimum MMIO (BAR0) length to safely cover the maximum register offset
accessed by the driver */
Thanks, Would something like this be a bit better?
/*
* Smallest BAR0 that covers every register the driver accesses
*/
make sense to me, will respin soon