Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 737423D331A for ; Wed, 22 Apr 2026 13:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776866270; cv=none; b=AZciQaPTB4GzGGo9sfmtev36TePIdXyws8arDiGf/VtvSbo/9tMhAyCOZxx3nyWSF6SQ+/yLQeWDw2L10URWLqcuOJqYxG8g2wUumYKiSISt6gbY87Lp/0A88dsN948cl7B0O4yV7Ya7o1FdOr+hQkbJ5NSMKoHA21P11Z+dEqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776866270; c=relaxed/simple; bh=Np5CX9CRxWfSzoUXCsQ6Yd3Cv0uXiU4hSOJunjy8TW0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bkx9S20HbU0YLBcquCtKeReGfT59deHOl+Nl4QP9TAL6yKlODG8M+zSBpifhK0zUbiDYBTZNUSOcZ9iiLweTwq+EJiQNpEMkM6TwSZQ8c/BwNjINbYOUzmgcffCGf3y3CXS3YrixarOg5KTykc/1TUnKaePa7pjr9bFEDvPFoHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Vyi9wo/g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Vyi9wo/g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 098CFC19425; Wed, 22 Apr 2026 13:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776866270; bh=Np5CX9CRxWfSzoUXCsQ6Yd3Cv0uXiU4hSOJunjy8TW0=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Vyi9wo/grDg4NvmSZJvqU0lrk+1JqyXoE/h0ku4cSPUgVQEoJcuv7csF/cRX4wCuq JyULUmZMHuEXcrCkUF9v3v31Lh6YtNRyrDCDAFNoH9JaACIQaDoboiDITfKn8NpuYn JKdd8dA54po3K6OOpQ1/qDPikwHnXcTpIeynffrI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31494: net: macb: use the current queue number for stats Date: Wed, 22 Apr 2026 15:54:40 +0200 Message-ID: <2026042202-CVE-2026-31494-647e@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5571; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ui4Pma9A1uRIZTu79cDSzPA9wFDdYN6G98yK0FclOAY=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkvLv32D84w+WD2YZ3Rzdupt/+q/GWxlyiVns8xZ84T5 dm6S0OkOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiQvcY5hd+/Win/npn/9e+ ORLKS9//zvrz0pphDodS3b8of+HcWbKZ7bNTTN3NP674AgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: net: macb: use the current queue number for stats There's a potential mismatch between the memory reserved for statistics and the amount of memory written. gem_get_sset_count() correctly computes the number of stats based on the active queues, whereas gem_get_ethtool_stats() indiscriminately copies data using the maximum number of queues, and in the case the number of active queues is less than MACB_MAX_QUEUES, this results in a OOB write as observed in the KASAN splat. ================================================================== BUG: KASAN: vmalloc-out-of-bounds in gem_get_ethtool_stats+0x54/0x78 [macb] Write of size 760 at addr ffff80008080b000 by task ethtool/1027 CPU: [...] Tainted: [E]=UNSIGNED_MODULE Hardware name: raspberrypi rpi/rpi, BIOS 2025.10 10/01/2025 Call trace: show_stack+0x20/0x38 (C) dump_stack_lvl+0x80/0xf8 print_report+0x384/0x5e0 kasan_report+0xa0/0xf0 kasan_check_range+0xe8/0x190 __asan_memcpy+0x54/0x98 gem_get_ethtool_stats+0x54/0x78 [macb 926c13f3af83b0c6fe64badb21ec87d5e93fcf65] dev_ethtool+0x1220/0x38c0 dev_ioctl+0x4ac/0xca8 sock_do_ioctl+0x170/0x1d8 sock_ioctl+0x484/0x5d8 __arm64_sys_ioctl+0x12c/0x1b8 invoke_syscall+0xd4/0x258 el0_svc_common.constprop.0+0xb4/0x240 do_el0_svc+0x48/0x68 el0_svc+0x40/0xf8 el0t_64_sync_handler+0xa0/0xe8 el0t_64_sync+0x1b0/0x1b8 The buggy address belongs to a 1-page vmalloc region starting at 0xffff80008080b000 allocated at dev_ethtool+0x11f0/0x38c0 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff00000a333000 pfn:0xa333 flags: 0x7fffc000000000(node=0|zone=0|lastcpupid=0x1ffff) raw: 007fffc000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff00000a333000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff80008080b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff80008080b100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff80008080b180: 00 00 00 00 00 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffff80008080b200: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffff80008080b280: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ================================================================== Fix it by making sure the copied size only considers the active number of queues. The Linux kernel CVE team has assigned CVE-2026-31494 to this issue. Affected and fixed versions =========================== Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 5.10.253 with commit 9738be665544281aa624842812c2fbfed6f88226 Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 5.15.203 with commit 240c5302eed83e34e98db18f6795ee5f40814024 Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 6.1.168 with commit 9596759a84e1dbf2670518d85e969208960041f9 Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 6.6.131 with commit 95246341945163ad9a250a87ca5bd1c1252777ae Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 6.12.80 with commit 9d74d10e4e26672e139a8bcf8bf95957bf2d160f Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 6.18.21 with commit 7ff87da099210856cbfe2f2f7f52ddfa57af4f0c Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 6.19.11 with commit e182fe273cdf5a8931592228196ef514ffac392b Issue introduced in 4.16 with commit 512286bbd4b7d5b15d26ba8078c8bfd1fc1129bd and fixed in 7.0 with commit 72d96e4e24bbefdcfbc68bdb9341a05d8f5cb6e5 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31494 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/ethernet/cadence/macb_main.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/9738be665544281aa624842812c2fbfed6f88226 https://git.kernel.org/stable/c/240c5302eed83e34e98db18f6795ee5f40814024 https://git.kernel.org/stable/c/9596759a84e1dbf2670518d85e969208960041f9 https://git.kernel.org/stable/c/95246341945163ad9a250a87ca5bd1c1252777ae https://git.kernel.org/stable/c/9d74d10e4e26672e139a8bcf8bf95957bf2d160f https://git.kernel.org/stable/c/7ff87da099210856cbfe2f2f7f52ddfa57af4f0c https://git.kernel.org/stable/c/e182fe273cdf5a8931592228196ef514ffac392b https://git.kernel.org/stable/c/72d96e4e24bbefdcfbc68bdb9341a05d8f5cb6e5