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 AE73A2E7623 for ; Wed, 1 Oct 2025 11:57:15 +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=1759319835; cv=none; b=DcPoDW7oAkcqhTyqz7qx5Z6oPcb0iuXOf/TW1e9OGaoZvWCh8p9C8zLcgMwbTOTqr9vehUGULvUjbEWJs3Isc1nYYwTLg49niyBB7msfHN8A/tbD1O5bBOJ4LCcI16y2laPMvxX9q/NO24C5siMZ7XAbkRHoAT59r3j7GLKsHvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759319835; c=relaxed/simple; bh=GCFd3r+0/z+0Nfd9ZkbQUJDHCzVdQNN3YRXFpVKSaw8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DHl1DnzEUzMGKFhwyz1qxWf1wnJxQSxOpK5m7Tf8eECExJ8sH71KKQd/Gnhi4WW/chKpVE0ZPLBx3AevbMgREpdrgbRygB57HgidzIWC5MlgvZTZTa49khqqGXD0wHSJCZSI7pWFyItvzJjBogRWgSOiFQeONA+HLBXTHiyWEYY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AJ/tpbA1; 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="AJ/tpbA1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CC83C4CEF4; Wed, 1 Oct 2025 11:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759319835; bh=GCFd3r+0/z+0Nfd9ZkbQUJDHCzVdQNN3YRXFpVKSaw8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=AJ/tpbA1+k9VxWTTNd4qw9cn43rEgfA17Jl6Vksd6EVbS0FB5YKs/jSpDXG/Vyih7 dt4z9Fjmb4+s1rY/MACaNYb1GIvl9M+1OFLqYCqM7zsrt3qbKds8EAHF9Lc31wS7P0 Src5FXPHsk6KINwn0XuIGd7XrbJ9yCrBpgVoI8HI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53509: qed: allow sleep in qed_mcp_trace_dump() Date: Wed, 1 Oct 2025 13:46:01 +0200 Message-ID: <2025100129-CVE-2023-53509-2b4c@gregkh> X-Mailer: git-send-email 2.51.0 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=5854; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HY3bKokBhmJBb/JQzXMczAriqKiBuCPb/mS5fVIHJkI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl3RSK7f78/ftCx4+2GI30nRG/vk956w9+DK2g9y09t5 ZDPVToSHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRCW4M8xMeC6/i0FOtfjQ9 6M/yrItasq/MuhgWbJn1M1KpouSpVrLmvCM7D/Vvi5Z4AAA= 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: qed: allow sleep in qed_mcp_trace_dump() By default, qed_mcp_cmd_and_union() delays 10us at a time in a loop that can run 500K times, so calls to qed_mcp_nvm_rd_cmd() may block the current thread for over 5s. We observed thread scheduling delays over 700ms in production, with stacktraces pointing to this code as the culprit. qed_mcp_trace_dump() is called from ethtool, so sleeping is permitted. It already can sleep in qed_mcp_halt(), which calls qed_mcp_cmd(). Add a "can sleep" parameter to qed_find_nvram_image() and qed_nvram_read() so they can sleep during qed_mcp_trace_dump(). qed_mcp_trace_get_meta_info() and qed_mcp_trace_read_meta(), called only by qed_mcp_trace_dump(), allow these functions to sleep. I can't tell if the other caller (qed_grc_dump_mcp_hw_dump()) can sleep, so keep b_can_sleep set to false when it calls these functions. An example stacktrace from a custom warning we added to the kernel showing a thread that has not scheduled despite long needing resched: [ 2745.362925,17] ------------[ cut here ]------------ [ 2745.362941,17] WARNING: CPU: 23 PID: 5640 at arch/x86/kernel/irq.c:233 do_IRQ+0x15e/0x1a0() [ 2745.362946,17] Thread not rescheduled for 744 ms after irq 99 [ 2745.362956,17] Modules linked in: ... [ 2745.363339,17] CPU: 23 PID: 5640 Comm: lldpd Tainted: P O 4.4.182+ #202104120910+6d1da174272d.61x [ 2745.363343,17] Hardware name: FOXCONN MercuryB/Quicksilver Controller, BIOS H11P1N09 07/08/2020 [ 2745.363346,17] 0000000000000000 ffff885ec07c3ed8 ffffffff8131eb2f ffff885ec07c3f20 [ 2745.363358,17] ffffffff81d14f64 ffff885ec07c3f10 ffffffff81072ac2 ffff88be98ed0000 [ 2745.363369,17] 0000000000000063 0000000000000174 0000000000000074 0000000000000000 [ 2745.363379,17] Call Trace: [ 2745.363382,17] [] dump_stack+0x8e/0xcf [ 2745.363393,17] [] warn_slowpath_common+0x82/0xc0 [ 2745.363398,17] [] warn_slowpath_fmt+0x4c/0x50 [ 2745.363404,17] [] ? rcu_irq_exit+0xae/0xc0 [ 2745.363408,17] [] do_IRQ+0x15e/0x1a0 [ 2745.363413,17] [] common_interrupt+0x89/0x89 [ 2745.363416,17] [] ? delay_tsc+0x24/0x50 [ 2745.363425,17] [] __udelay+0x34/0x40 [ 2745.363457,17] [] qed_mcp_cmd_and_union+0x36f/0x7d0 [qed] [ 2745.363473,17] [] qed_mcp_nvm_rd_cmd+0x4d/0x90 [qed] [ 2745.363490,17] [] qed_mcp_trace_dump+0x4a7/0x630 [qed] [ 2745.363504,17] [] ? qed_fw_asserts_dump+0x1d6/0x1f0 [qed] [ 2745.363520,17] [] qed_dbg_mcp_trace_get_dump_buf_size+0x37/0x80 [qed] [ 2745.363536,17] [] qed_dbg_feature_size+0x61/0xa0 [qed] [ 2745.363551,17] [] qed_dbg_all_data_size+0x247/0x260 [qed] [ 2745.363560,17] [] qede_get_regs_len+0x30/0x40 [qede] [ 2745.363566,17] [] ethtool_get_drvinfo+0xe3/0x190 [ 2745.363570,17] [] dev_ethtool+0x1362/0x2140 [ 2745.363575,17] [] ? finish_task_switch+0x76/0x260 [ 2745.363580,17] [] ? __schedule+0x3c6/0x9d0 [ 2745.363585,17] [] ? hrtimer_start_range_ns+0x1d0/0x370 [ 2745.363589,17] [] ? dev_get_by_name_rcu+0x6b/0x90 [ 2745.363594,17] [] dev_ioctl+0xe8/0x710 [ 2745.363599,17] [] sock_do_ioctl+0x48/0x60 [ 2745.363603,17] [] sock_ioctl+0x1c7/0x280 [ 2745.363608,17] [] ? seccomp_phase1+0x83/0x220 [ 2745.363612,17] [] do_vfs_ioctl+0x2b3/0x4e0 [ 2745.363616,17] [] SyS_ioctl+0x41/0x70 [ 2745.363619,17] [] entry_SYSCALL_64_fastpath+0x1e/0x79 [ 2745.363622,17] ---[ end trace f6954aa440266421 ]--- The Linux kernel CVE team has assigned CVE-2023-53509 to this issue. Affected and fixed versions =========================== Issue introduced in 4.9 with commit c965db44462919f613973aa618271f6c3f5a1e64 and fixed in 6.0.19 with commit e0387f4f39a8d92302273ac356d1f6b2a38160d8 Issue introduced in 4.9 with commit c965db44462919f613973aa618271f6c3f5a1e64 and fixed in 6.1.5 with commit 50c81b35df01db12b348c5cbf4b1917dc9a7db54 Issue introduced in 4.9 with commit c965db44462919f613973aa618271f6c3f5a1e64 and fixed in 6.2 with commit 5401c3e0992860b11fb4b25796e4c4f1921740df 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-2023-53509 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/qlogic/qed/qed_debug.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/e0387f4f39a8d92302273ac356d1f6b2a38160d8 https://git.kernel.org/stable/c/50c81b35df01db12b348c5cbf4b1917dc9a7db54 https://git.kernel.org/stable/c/5401c3e0992860b11fb4b25796e4c4f1921740df