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 6189832861F for ; Tue, 16 Dec 2025 14:04:22 +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=1765893862; cv=none; b=mGlwt3RqwiZzXvkkkhjqspRIap450T5RfQ27qbHS+z4zGE8nS1Jb2Dpfp9pZWWamtPYE9XrU03jSMrcs97LaDGs2IJ1CJ3G/+xv5SJLuLeAZ+7qoWZON2D/BMPGEqFQIs5tXtiJCY8JvE6K7tU6pU7CvGr4cIMAe5YtKgxSzg14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765893862; c=relaxed/simple; bh=cahJO8sBkYb2hFXtB7jOew4Se4LOYkNzuBuBam9sXbg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ojc2H0jp8eB/HhWQ2uYKQwyvdLnRLgAoZ7sB8YpGc6yzAkxMyOrRAygeiJDK0y4kq6YEcDC3CEi/YcPiWEoWJVQTva1JeFZV8FDQCZm+KCT0KL4NX6Le/mXvH6dlkHv0cBchNsLlndnJZzreBa9FSeaxJYm8gkMq7AdK7NQ2DdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XtMY5x/Y; 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="XtMY5x/Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89C2DC4CEF5; Tue, 16 Dec 2025 14:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765893862; bh=cahJO8sBkYb2hFXtB7jOew4Se4LOYkNzuBuBam9sXbg=; h=From:To:Cc:Subject:Date:Reply-To:From; b=XtMY5x/YonoBCLUJ49KjiOJ2nbdfjHS3StvdAXlfGJmt1uG/TBbBsluKLPhix45lR 4E+ZH4YZmTRf3whyAocUr2mBvmQxVnCvc03XuOroOQHjkcqgWnxEvL6OFG3PLiggqP 9oU6XABlven7Ns4lygnTCdJ2ZRuDpGxw/qaV0YWA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-68232: veth: more robust handing of race to avoid txq getting stuck Date: Tue, 16 Dec 2025 15:04:18 +0100 Message-ID: <2025121617-CVE-2025-68232-3ea7@gregkh> X-Mailer: git-send-email 2.52.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=4210; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HpuWJrfz/Jgd+aqyRcmCMKpyoZH90dv7KS+UpyU6q0M=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmOaQ8txcqDZs3KCxVf5P/m6/rMP7ukYzmC3ZJmtT2rb 3135srUjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIsi8MC9Y9lQ1RvrL5qbue qm6W0oL2TxGH6xgWrFn7dn+w9WfZxNfZnZFWTwSMD91NAQA= 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: veth: more robust handing of race to avoid txq getting stuck Commit dc82a33297fc ("veth: apply qdisc backpressure on full ptr_ring to reduce TX drops") introduced a race condition that can lead to a permanently stalled TXQ. This was observed in production on ARM64 systems (Ampere Altra Max). The race occurs in veth_xmit(). The producer observes a full ptr_ring and stops the queue (netif_tx_stop_queue()). The subsequent conditional logic, intended to re-wake the queue if the consumer had just emptied it (if (__ptr_ring_empty(...)) netif_tx_wake_queue()), can fail. This leads to a "lost wakeup" where the TXQ remains stopped (QUEUE_STATE_DRV_XOFF) and traffic halts. This failure is caused by an incorrect use of the __ptr_ring_empty() API from the producer side. As noted in kernel comments, this check is not guaranteed to be correct if a consumer is operating on another CPU. The empty test is based on ptr_ring->consumer_head, making it reliable only for the consumer. Using this check from the producer side is fundamentally racy. This patch fixes the race by adopting the more robust logic from an earlier version V4 of the patchset, which always flushed the peer: (1) In veth_xmit(), the racy conditional wake-up logic and its memory barrier are removed. Instead, after stopping the queue, we unconditionally call __veth_xdp_flush(rq). This guarantees that the NAPI consumer is scheduled, making it solely responsible for re-waking the TXQ. This handles the race where veth_poll() consumes all packets and completes NAPI *before* veth_xmit() on the producer side has called netif_tx_stop_queue. The __veth_xdp_flush(rq) will observe rx_notify_masked is false and schedule NAPI. (2) On the consumer side, the logic for waking the peer TXQ is moved out of veth_xdp_rcv() and placed at the end of the veth_poll() function. This placement is part of fixing the race, as the netif_tx_queue_stopped() check must occur after rx_notify_masked is potentially set to false during NAPI completion. This handles the race where veth_poll() consumes all packets, but haven't finished (rx_notify_masked is still true). The producer veth_xmit() stops the TXQ and __veth_xdp_flush(rq) will observe rx_notify_masked is true, meaning not starting NAPI. Then veth_poll() change rx_notify_masked to false and stops NAPI. Before exiting veth_poll() will observe TXQ is stopped and wake it up. The Linux kernel CVE team has assigned CVE-2025-68232 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit dc82a33297fc2c58cb0b2b008d728668d45c0f6a and fixed in 6.17.10 with commit 6c8a8b9257a660e622689e23c8fbad4ba2b561b9 Issue introduced in 6.16 with commit dc82a33297fc2c58cb0b2b008d728668d45c0f6a and fixed in 6.18 with commit 5442a9da69789741bfda39f34ee7f69552bf0c56 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-2025-68232 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/veth.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/dd419a3f2ebc18cc00bc32c57fd052d7a188b78b https://git.kernel.org/stable/c/6c8a8b9257a660e622689e23c8fbad4ba2b561b9 https://git.kernel.org/stable/c/5442a9da69789741bfda39f34ee7f69552bf0c56