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 89C0D1A5B8A for ; Wed, 26 Feb 2025 01:58:11 +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=1740535091; cv=none; b=fXFbzut7REoqLoz6RZ8S4BbOecvm+86AMVv23SMDHZQxx+y/lgxb5hxCvMil7WfzoggCmsNAoX9BwdomJHVrk1WJVKz7T354maKZjLK8d2Dy/Fc89zxRxj9nbgflNphaRjjDZLLtrWqOwPLqKUkuvun5hDBFQX3NZcla6WOoo5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535091; c=relaxed/simple; bh=aed3EP+A+bMeqCodx4A6T2DOagZC97djJOmIEBOCR4U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GxZh5vSDxkfBrsG27HRKDzcQ4kV1if8Bs5Km4O6yLgw8kqnEATypTSNDbG8T+TLh73hsnK3LC2/iPSyceEZ+QsaNt7N/kBcswEP0TfyFRLgaWSmGOsNwIML6zpuPupV/C9yut11gvxKl4iyG3pDaim3Yqea4pVSMDgjRE82CUvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xo0tKotG; 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="Xo0tKotG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F657C4CEDD; Wed, 26 Feb 2025 01:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535091; bh=aed3EP+A+bMeqCodx4A6T2DOagZC97djJOmIEBOCR4U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Xo0tKotG3+M8NwPNanfQdViqCXb+jzEm9CVjl2Xrh857e7PU73k+wnM8v0/72nc8b +e6n6FmxaSxcMWnK2SOymv7Y20P5tRxJp/5deh4RTqQYjQZSX+jQVwHKZhkslRIOlI vSlLlFev1xKWA5aFe5sGaY0r8fCZmgGQiPaPcAQg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49096: net: sfc: add missing xdp queue reinitialization Date: Wed, 26 Feb 2025 02:55:01 +0100 Message-ID: <2025022659-CVE-2022-49096-3214@gregkh> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=5081; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aed3EP+A+bMeqCodx4A6T2DOagZC97djJOmIEBOCR4U=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Ssz173IJ//ii9+Q4g17WfaedU6oDt3ovuBc1OfRRz jGzgt6DHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR1/cZFhwpzeeU/jtZziV2 Sw6XhPHrc3OeLmGY7y114GuWV6r18UfL1zJZl9wtedK/GwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: sfc: add missing xdp queue reinitialization After rx/tx ring buffer size is changed, kernel panic occurs when it acts XDP_TX or XDP_REDIRECT. When tx/rx ring buffer size is changed(ethtool -G), sfc driver reallocates and reinitializes rx and tx queues and their buffer (tx_queue->buffer). But it misses reinitializing xdp queues(efx->xdp_tx_queues). So, while it is acting XDP_TX or XDP_REDIRECT, it uses the uninitialized tx_queue->buffer. A new function efx_set_xdp_channels() is separated from efx_set_channels() to handle only xdp queues. Splat looks like: BUG: kernel NULL pointer dereference, address: 000000000000002a #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#4] PREEMPT SMP NOPTI RIP: 0010:efx_tx_map_chunk+0x54/0x90 [sfc] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 5.17.0+ #55 e8beeee8289528f11357029357cf Code: 48 8b 8d a8 01 00 00 48 8d 14 52 4c 8d 2c d0 44 89 e0 48 85 c9 74 0e 44 89 e2 4c 89 f6 48 80 RSP: 0018:ffff92f121e45c60 EFLAGS: 00010297 RIP: 0010:efx_tx_map_chunk+0x54/0x90 [sfc] RAX: 0000000000000040 RBX: ffff92ea506895c0 RCX: ffffffffc0330870 RDX: 0000000000000001 RSI: 00000001139b10ce RDI: ffff92ea506895c0 RBP: ffffffffc0358a80 R08: 00000001139b110d R09: 0000000000000000 R10: 0000000000000001 R11: ffff92ea414c0088 R12: 0000000000000040 R13: 0000000000000018 R14: 00000001139b10ce R15: ffff92ea506895c0 FS: 0000000000000000(0000) GS:ffff92f121ec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Code: 48 8b 8d a8 01 00 00 48 8d 14 52 4c 8d 2c d0 44 89 e0 48 85 c9 74 0e 44 89 e2 4c 89 f6 48 80 CR2: 000000000000002a CR3: 00000003e6810004 CR4: 00000000007706e0 RSP: 0018:ffff92f121e85c60 EFLAGS: 00010297 PKRU: 55555554 RAX: 0000000000000040 RBX: ffff92ea50689700 RCX: ffffffffc0330870 RDX: 0000000000000001 RSI: 00000001145a90ce RDI: ffff92ea50689700 RBP: ffffffffc0358a80 R08: 00000001145a910d R09: 0000000000000000 R10: 0000000000000001 R11: ffff92ea414c0088 R12: 0000000000000040 R13: 0000000000000018 R14: 00000001145a90ce R15: ffff92ea50689700 FS: 0000000000000000(0000) GS:ffff92f121e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000002a CR3: 00000003e6810005 CR4: 00000000007706e0 PKRU: 55555554 Call Trace: efx_xdp_tx_buffers+0x12b/0x3d0 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] __efx_rx_packet+0x5c3/0x930 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] efx_rx_packet+0x28c/0x2e0 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] efx_ef10_ev_process+0x5f8/0xf40 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] ? enqueue_task_fair+0x95/0x550 efx_poll+0xc4/0x360 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] The Linux kernel CVE team has assigned CVE-2022-49096 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit 3990a8fffbdad5765f47ea593f9de66c91762059 and fixed in 5.15.34 with commit ed7a824fda8732578d1014fad1f7fb0363705090 Issue introduced in 5.5 with commit 3990a8fffbdad5765f47ea593f9de66c91762059 and fixed in 5.16.20 with commit b8c46bc358d84701e7f7ffa054037db25f25da0e Issue introduced in 5.5 with commit 3990a8fffbdad5765f47ea593f9de66c91762059 and fixed in 5.17.3 with commit dcc85e1593686e42c6749ef3d356db34759d59e8 Issue introduced in 5.5 with commit 3990a8fffbdad5765f47ea593f9de66c91762059 and fixed in 5.18 with commit 059a47f1da93811d37533556d67e72f2261b1127 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-2022-49096 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/sfc/efx_channels.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/ed7a824fda8732578d1014fad1f7fb0363705090 https://git.kernel.org/stable/c/b8c46bc358d84701e7f7ffa054037db25f25da0e https://git.kernel.org/stable/c/dcc85e1593686e42c6749ef3d356db34759d59e8 https://git.kernel.org/stable/c/059a47f1da93811d37533556d67e72f2261b1127