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 418CD1DD0FC for ; Tue, 5 Nov 2024 17:12:00 +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=1730826720; cv=none; b=mRI6LmoWZbMgL4EMh+ymUDiFj0L43HX1dw76IguXEQmHhvN/ZFihm6P/ynFUBqe3CMNZ3k7iAYe7st84ZNbWIgGpJQhDgedyG2esKOPieMe/IJfzCzDX/qLaYsdPlgQ42SEwgA4NEzA8FtVhWWs4/rXsifpAI751FCjxlwtXfaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730826720; c=relaxed/simple; bh=UgRg+4XGrlvJtDhqHoDTUNwAaHdm5qsm+rUYA7pmJf4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZbdElelWPPHy/nrNS1NQ/QULsVDlfrK94e4TBxpp0X05xL8TwAm5NoldvJTOv+2+nP2F7wZtSNuds0SA5lpWnoipQktxOqkqEehkquG64L7aJSKQHSQpKBKAcsst6N/5yapbf/zhSLxxXOno6JCPUfGn8f/ExqEAyBCARuiDQ6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SPiJhWwm; 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="SPiJhWwm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4FE1C4CECF; Tue, 5 Nov 2024 17:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730826720; bh=UgRg+4XGrlvJtDhqHoDTUNwAaHdm5qsm+rUYA7pmJf4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SPiJhWwmvPrJp87TsNrp0AW8J16oL4nWNfMdyRPEN+AhZCA5MV05M69/EpSkdrVvR uGFWs6Sw1KTYIpo3rKp86R1vCbYjFrbUiPSL4ePjq4QkDT5BvGkhMYJCQRqACeRjgO jfeBHioLrKdw+IbEoByHmGBtpXpwrtYXLa42csIA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50122: PCI: Hold rescan lock while adding devices during host probe Date: Tue, 5 Nov 2024 18:11:11 +0100 Message-ID: <2024110556-CVE-2024-50122-c520@gregkh> X-Mailer: git-send-email 2.47.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=2703; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UgRg+4XGrlvJtDhqHoDTUNwAaHdm5qsm+rUYA7pmJf4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlagQtUvtv8XX1yS+v7aFUdj5VXSy6Yvbl2WvRgxw15+ eO23YcmdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEygMY5ofsEecpkHeJe35E TfFV0c8n09v9LBgWnJ/gKPLopmPbBAmzx5/PL9CeYXN9FwA= 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: PCI: Hold rescan lock while adding devices during host probe Since adding the PCI power control code, we may end up with a race between the pwrctl platform device rescanning the bus and host controller probe functions. The latter need to take the rescan lock when adding devices or we may end up in an undefined state having two incompletely added devices and hit the following crash when trying to remove the device over sysfs: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Internal error: Oops: 0000000096000004 [#1] SMP Call trace: __pi_strlen+0x14/0x150 kernfs_find_ns+0x80/0x13c kernfs_remove_by_name_ns+0x54/0xf0 sysfs_remove_bin_file+0x24/0x34 pci_remove_resource_files+0x3c/0x84 pci_remove_sysfs_dev_files+0x28/0x38 pci_stop_bus_device+0x8c/0xd8 pci_stop_bus_device+0x40/0xd8 pci_stop_and_remove_bus_device_locked+0x28/0x48 remove_store+0x70/0xb0 dev_attr_store+0x20/0x38 sysfs_kf_write+0x58/0x78 kernfs_fop_write_iter+0xe8/0x184 vfs_write+0x2dc/0x308 ksys_write+0x7c/0xec The Linux kernel CVE team has assigned CVE-2024-50122 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit 4565d2652a37 and fixed in 6.11.6 with commit d4f38a0e7cc9 Issue introduced in 6.11 with commit 4565d2652a37 and fixed in 6.12-rc5 with commit 1d59d474e1cb 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-50122 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/pci/probe.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/d4f38a0e7cc94615f63cf7765ca117e5cc2773ae https://git.kernel.org/stable/c/1d59d474e1cb7d4fdf87dfaf96f44647f13ea590