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 6BDEE155CAF for ; Mon, 29 Jul 2024 15:54:10 +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=1722268450; cv=none; b=W3GxYnjVaAwgEgbbdJpBBC7m+mDoPBaHbDlzMRyWZYOTMaBYfn/lio/roPQxijsCcQhPUoqTMu+bMlqzHaI8VkiiWppEfrMdoMb4qzu7vo8uyyjUfyPK2RNtLmfuTCNV5PAn+9L9zVUDdYqRHIvCPeWCdMCR50ZL144Ftd8tGvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722268450; c=relaxed/simple; bh=PmZqNwmP2ATgd5rMfLVDPVCKywhUpFHAqfzpD5ZYXE0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CXy9U3/XbVmkVYNtr3b+LbMQ70Vi4mLuK/yXjRToUeh35Y4TCXYnpEK7hJVfj/l4Z1MhBgxaGpRA3N4wullQ6eamzoH8bVO2LOtsTc2lsAgeeCLQBY36Dr9rmNeoxYKMUnDLZfu2aZTP85TyBUQPfGS3Ag6kHMwKG/W/rQHvEzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dp6fa2eL; 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="dp6fa2eL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90B26C32786; Mon, 29 Jul 2024 15:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722268450; bh=PmZqNwmP2ATgd5rMfLVDPVCKywhUpFHAqfzpD5ZYXE0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=dp6fa2eLRnqwkYwHg3rgQ+nErYnUrtNGpG/BTLzSEv14hYdmnxLYjNPBv14Z8Dvzk aBYh/1Dabtr9iFn9WxuXjk7PGiV8WSuNS6819PfIlKpnMraeGb+dJ9UYEGyCqNgGYR UHaGwv5AizqGBQ/JItZlAkUza2Nd6PNniOLkmns4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42071: ionic: use dev_consume_skb_any outside of napi Date: Mon, 29 Jul 2024 17:53:00 +0200 Message-ID: <2024072952-CVE-2024-42071-1749@gregkh> X-Mailer: git-send-email 2.45.2 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=3678; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PmZqNwmP2ATgd5rMfLVDPVCKywhUpFHAqfzpD5ZYXE0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnLd105ruZzboNq2az/BufY9/h+Cf1/ctbCxu9ajmpH8 7IbYjf4dsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEmhMZ5ufwV3m/bmj4qeXe uOHIbp9zWpcvPWBYsIJbp9H+eUt0+kWB6R+/121gqDm0EAA= 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: ionic: use dev_consume_skb_any outside of napi If we're not in a NAPI softirq context, we need to be careful about how we call napi_consume_skb(), specifically we need to call it with budget==0 to signal to it that we're not in a safe context. This was found while running some configuration stress testing of traffic and a change queue config loop running, and this curious note popped out: [ 4371.402645] BUG: using smp_processor_id() in preemptible [00000000] code: ethtool/20545 [ 4371.402897] caller is napi_skb_cache_put+0x16/0x80 [ 4371.403120] CPU: 25 PID: 20545 Comm: ethtool Kdump: loaded Tainted: G OE 6.10.0-rc3-netnext+ #8 [ 4371.403302] Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 01/23/2021 [ 4371.403460] Call Trace: [ 4371.403613] [ 4371.403758] dump_stack_lvl+0x4f/0x70 [ 4371.403904] check_preemption_disabled+0xc1/0xe0 [ 4371.404051] napi_skb_cache_put+0x16/0x80 [ 4371.404199] ionic_tx_clean+0x18a/0x240 [ionic] [ 4371.404354] ionic_tx_cq_service+0xc4/0x200 [ionic] [ 4371.404505] ionic_tx_flush+0x15/0x70 [ionic] [ 4371.404653] ? ionic_lif_qcq_deinit.isra.23+0x5b/0x70 [ionic] [ 4371.404805] ionic_txrx_deinit+0x71/0x190 [ionic] [ 4371.404956] ionic_reconfigure_queues+0x5f5/0xff0 [ionic] [ 4371.405111] ionic_set_ringparam+0x2e8/0x3e0 [ionic] [ 4371.405265] ethnl_set_rings+0x1f1/0x300 [ 4371.405418] ethnl_default_set_doit+0xbb/0x160 [ 4371.405571] genl_family_rcv_msg_doit+0xff/0x130 [...] I found that ionic_tx_clean() calls napi_consume_skb() which calls napi_skb_cache_put(), but before that last call is the note /* Zero budget indicate non-NAPI context called us, like netpoll */ and DEBUG_NET_WARN_ON_ONCE(!in_softirq()); Those are pretty big hints that we're doing it wrong. We can pass a context hint down through the calls to let ionic_tx_clean() know what we're doing so it can call napi_consume_skb() correctly. The Linux kernel CVE team has assigned CVE-2024-42071 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 386e69865311 and fixed in 6.9.8 with commit ef7646ed49ff Issue introduced in 6.9 with commit 386e69865311 and fixed in 6.10 with commit 84b767f9e34f 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-2024-42071 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/pensando/ionic/ionic_dev.h drivers/net/ethernet/pensando/ionic/ionic_lif.c drivers/net/ethernet/pensando/ionic/ionic_txrx.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/ef7646ed49fff962e97b276f4ab91327a67eeb5a https://git.kernel.org/stable/c/84b767f9e34fdb143c09e66a2a20722fc2921821