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 8A3DF15D5B7 for ; Fri, 13 Sep 2024 05:31:41 +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=1726205501; cv=none; b=gW6ZPc1ePq1rzMlAoP9Duk6wYuaDPKBhIzwJvjWIuLbTC+zXYw+BJIs4bmNef5EeioYZlrk9gf7rDrUi42xN5N1omOk6UgQ7HeWXbYZzJEQ0omYO/c50hfZyZwRfCNSMomjEUcSGqGUCkzSJK1X9TU9ODIVmRLXeK5/bXv6BMuc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726205501; c=relaxed/simple; bh=rREeVvQYpP3x8NtefMji89K1e6OohIKKrCwVeMHRhIc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pbTpNZLRrUo+UasbCli454Pp4fi2I/HI9h7nfEjTCfyQ7920f5Und+ymwF56+AcCbHdI8sqtQs5Cj865jEP2EnC4Ur2TeNUbmOBPWkOIkD7CM21UtcmenWNFUct2grIB81C0jmjxxVD6gmajwwguyl/hFNZBQrjTi3YzqYQ+aeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FPIF+XcO; 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="FPIF+XcO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11E7BC4CEC0; Fri, 13 Sep 2024 05:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1726205501; bh=rREeVvQYpP3x8NtefMji89K1e6OohIKKrCwVeMHRhIc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FPIF+XcOziIjsdiqUOGnNw8f1KmdLCRRYi4LIASFV50fZ0Vz7SZbaN19Ke3WwjGJm CdBF1qCv6v248tP7KhjOlmxi+/F/6CL14GEdn3DtUuOZyp25IUvccPN1vqkWj0DPhS JE0Hz/bgD65ch3DF8K8qqaw18jOIoy/L2qduUND4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-46698: video/aperture: optionally match the device in sysfb_disable() Date: Fri, 13 Sep 2024 07:30:59 +0200 Message-ID: <2024091341-CVE-2024-46698-357c@gregkh> X-Mailer: git-send-email 2.46.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=2808; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rREeVvQYpP3x8NtefMji89K1e6OohIKKrCwVeMHRhIc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmPzzF+/KW5/krfGq2TakWb7jw7rvZ123z7I3oxJgYZZ fEL1j650RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATETVmWHDs1slJNZ3x8iGX X0+y6srUtOKWSGaYKzx9yma5B7W6lxMfmWhyGv9n5p2/GQA= 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: video/aperture: optionally match the device in sysfb_disable() In aperture_remove_conflicting_pci_devices(), we currently only call sysfb_disable() on vga class devices. This leads to the following problem when the pimary device is not VGA compatible: 1. A PCI device with a non-VGA class is the boot display 2. That device is probed first and it is not a VGA device so sysfb_disable() is not called, but the device resources are freed by aperture_detach_platform_device() 3. Non-primary GPU has a VGA class and it ends up calling sysfb_disable() 4. NULL pointer dereference via sysfb_disable() since the resources have already been freed by aperture_detach_platform_device() when it was called by the other device. Fix this by passing a device pointer to sysfb_disable() and checking the device to determine if we should execute it or not. v2: Fix build when CONFIG_SCREEN_INFO is not set v3: Move device check into the mutex Drop primary variable in aperture_remove_conflicting_pci_devices() Drop __init on pci sysfb_pci_dev_is_enabled() The Linux kernel CVE team has assigned CVE-2024-46698 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit 5ae3716cfdcd and fixed in 6.10.8 with commit 17e78f43de0c Issue introduced in 6.5 with commit 5ae3716cfdcd and fixed in 6.11-rc6 with commit b49420d6a1ae Issue introduced in 6.1.47 with commit 485ec8f8e1d8 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-46698 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/firmware/sysfb.c drivers/of/platform.c drivers/video/aperture.c include/linux/sysfb.h 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/17e78f43de0c6da34204cc858b4cc05671ea9acf https://git.kernel.org/stable/c/b49420d6a1aeb399e5b107fc6eb8584d0860fbd7