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 5888F30B52A for ; Thu, 18 Sep 2025 13:36:21 +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=1758202581; cv=none; b=nzzxRl13pHUodgcvSgqS32GyVeTaCHOUgVDk8dpmJLrLpF7FAj1AicK15OseQA/zRbA/IU6+UatpVdI/vtziGUzApMdef6FOLEFy3CBf5LmIyzFM1rKgorhDtzTtMs/qHouKVaUHa2VfyBW8xp+tIhR4DW6HTybxCPK1+SQB6DU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758202581; c=relaxed/simple; bh=fSQUXXX2AGapa6eWm4U1Qr49e5kuxbKJf5WHKaB39MY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J0qNhZ4kWVnIkCHJg6DGVBWsckHusA8VtkFlWhzFwf7fVY4NILmN9CgtDhk778/jcAhWuI5VFFrmI5+PVkHpuILrNrk5PBZdMnetqDTTFe9sNvK7Isn4YTnV0MLOgqQTkD3nEysdXdUHLKjbO0y+ebSInK8ogRDTsJ81/ZVPfLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nJmiLvj9; 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="nJmiLvj9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7E07C4CEE7; Thu, 18 Sep 2025 13:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758202581; bh=fSQUXXX2AGapa6eWm4U1Qr49e5kuxbKJf5WHKaB39MY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nJmiLvj97Y/epWU59lzZroM6NO+iHziWn6pVByrT0vHXt7WH/vhjXKxUdAGbBDwGn g2awRUJbHjBWYGsi/Q4KrcmGDgmX5nOVVhKXtLZY0KCtaRlRdrExZuojLzo1nZihDw nG/pWN+RQYYjfWVt5c6NS/l/sE6HAd8reumUovWU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53393: RDMA/mlx5: Fix mlx5_ib_get_hw_stats when used for device Date: Thu, 18 Sep 2025 15:34:38 +0200 Message-ID: <2025091858-CVE-2023-53393-5e45@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=4758; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=IEEGr9Z8kVfCWkMio6oktCsRR7Iq9omaNvgJsZmGCFk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlnuNymfElbKren+fLC6e1R61c//1DAnJovsszlwtEnm jxWT+IfdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEdsxkWLD7zPQouRfZlu0H Q809Lb48CHi2dibDXLHQHB2uUz4ST056ah26O9VOLdGBCQA= 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: RDMA/mlx5: Fix mlx5_ib_get_hw_stats when used for device Currently, when mlx5_ib_get_hw_stats() is used for device (port_num = 0), there is a special handling in order to use the correct counters, but, port_num is being passed down the stack without any change. Also, some functions assume that port_num >=1. As a result, the following oops can occur. BUG: unable to handle page fault for address: ffff89510294f1a8 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] SMP CPU: 8 PID: 1382 Comm: devlink Tainted: G W 6.1.0-rc4_for_upstream_base_2022_11_10_16_12 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:_raw_spin_lock+0xc/0x20 Call Trace: mlx5_ib_get_native_port_mdev+0x73/0xe0 [mlx5_ib] do_get_hw_stats.constprop.0+0x109/0x160 [mlx5_ib] mlx5_ib_get_hw_stats+0xad/0x180 [mlx5_ib] ib_setup_device_attrs+0xf0/0x290 [ib_core] ib_register_device+0x3bb/0x510 [ib_core] ? atomic_notifier_chain_register+0x67/0x80 __mlx5_ib_add+0x2b/0x80 [mlx5_ib] mlx5r_probe+0xb8/0x150 [mlx5_ib] ? auxiliary_match_id+0x6a/0x90 auxiliary_bus_probe+0x3c/0x70 ? driver_sysfs_add+0x6b/0x90 really_probe+0xcd/0x380 __driver_probe_device+0x80/0x170 driver_probe_device+0x1e/0x90 __device_attach_driver+0x7d/0x100 ? driver_allows_async_probing+0x60/0x60 ? driver_allows_async_probing+0x60/0x60 bus_for_each_drv+0x7b/0xc0 __device_attach+0xbc/0x200 bus_probe_device+0x87/0xa0 device_add+0x404/0x940 ? dev_set_name+0x53/0x70 __auxiliary_device_add+0x43/0x60 add_adev+0x99/0xe0 [mlx5_core] mlx5_attach_device+0xc8/0x120 [mlx5_core] mlx5_load_one_devl_locked+0xb2/0xe0 [mlx5_core] devlink_reload+0x133/0x250 devlink_nl_cmd_reload+0x480/0x570 ? devlink_nl_pre_doit+0x44/0x2b0 genl_family_rcv_msg_doit.isra.0+0xc2/0x110 genl_rcv_msg+0x180/0x2b0 ? devlink_nl_cmd_region_read_dumpit+0x540/0x540 ? devlink_reload+0x250/0x250 ? devlink_put+0x50/0x50 ? genl_family_rcv_msg_doit.isra.0+0x110/0x110 netlink_rcv_skb+0x54/0x100 genl_rcv+0x24/0x40 netlink_unicast+0x1f6/0x2c0 netlink_sendmsg+0x237/0x490 sock_sendmsg+0x33/0x40 __sys_sendto+0x103/0x160 ? handle_mm_fault+0x10e/0x290 ? do_user_addr_fault+0x1c0/0x5f0 __x64_sys_sendto+0x25/0x30 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fix it by setting port_num to 1 in order to get device status and remove unused variable. The Linux kernel CVE team has assigned CVE-2023-53393 to this issue. Affected and fixed versions =========================== Issue introduced in 4.16 with commit aac4492ef23a176b6f1a41aadb99177eceb1fc06 and fixed in 5.15.87 with commit 8d89870d63758363b07ace5c2df82d6bf865f78b Issue introduced in 4.16 with commit aac4492ef23a176b6f1a41aadb99177eceb1fc06 and fixed in 6.0.19 with commit 9a97da4674b890b4c28f5f12beba8c33a9cd2f49 Issue introduced in 4.16 with commit aac4492ef23a176b6f1a41aadb99177eceb1fc06 and fixed in 6.1.5 with commit e597b003c736217b0c99ccf1b240c25009105238 Issue introduced in 4.16 with commit aac4492ef23a176b6f1a41aadb99177eceb1fc06 and fixed in 6.2 with commit 38b50aa44495d5eb4218f0b82fc2da76505cec53 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-53393 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/infiniband/hw/mlx5/counters.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/8d89870d63758363b07ace5c2df82d6bf865f78b https://git.kernel.org/stable/c/9a97da4674b890b4c28f5f12beba8c33a9cd2f49 https://git.kernel.org/stable/c/e597b003c736217b0c99ccf1b240c25009105238 https://git.kernel.org/stable/c/38b50aa44495d5eb4218f0b82fc2da76505cec53