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 9BB421A5B86 for ; Wed, 26 Feb 2025 01:58:06 +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=1740535086; cv=none; b=rvzzl99MuSoap58onnlWsSOAq3NPEW7tW+UcOfDABqD7Q86corobsuyZ8lum32x42r6X0gYXg1u1yWbP8eEYRpBU4GRe/DQGtxgTVXwr8Foe4PzoPD8Byyj768hYeYCCa6dW/gda3Ov6KEGgSyn3yi5ZmukYnDNKOmRQZtYpyYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535086; c=relaxed/simple; bh=4at0SbGTeK0QOveYXS3TNg9cQQPnVMOlI2rrhnlSaLA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qqiMLXvmL4myYOCqK+aUu7m3w2E/FgTWn5IKSF47vNPjU749mysqInoxEmJr/fyVRx2IBg49VkCmIX36zsz822f51QcIp5bwUUuwnARCk9qkFOEOi11C/bUvc8pmdFH0Lg8WCaXF8sOsNrVVUd/2CKAKF7Hd2RFDxDyq7pzaC38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2WlkSKj4; 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="2WlkSKj4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69273C4CEDD; Wed, 26 Feb 2025 01:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535086; bh=4at0SbGTeK0QOveYXS3TNg9cQQPnVMOlI2rrhnlSaLA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2WlkSKj4m8tqXkNKP3JzmTuz5oQ8KD1CO2o1pF6822y6V++OMHb3FTvifX/Rprzmj s9eHBW7YreyjVIlRgX3sqG71cK2S5g0RtOjw4zE1G0f7Mszbr2W38yheZAA2AmsDx3 NnmJafSWhVoeEeXhDYDnLBhamRr9CeWNkh5DLXro= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49072: gpio: Restrict usage of GPIO chip irq members before initialization Date: Wed, 26 Feb 2025 02:54:37 +0100 Message-ID: <2025022655-CVE-2022-49072-8479@gregkh> X-Mailer: git-send-email 2.48.1 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=2844; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4at0SbGTeK0QOveYXS3TNg9cQQPnVMOlI2rrhnlSaLA=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Soz3xbG38abf3uE3Yc17s4QF0+UrDpfsKH0kmH4qM 10w9uC7jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIrzfDguMul5Q3fX2RM0m0 c7p3v+L5rY1m+gwLtoYtnMfKP+cj4+PgzKDZ905vnVwVBwA= 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: gpio: Restrict usage of GPIO chip irq members before initialization GPIO chip irq members are exposed before they could be completely initialized and this leads to race conditions. One such issue was observed for the gc->irq.domain variable which was accessed through the I2C interface in gpiochip_to_irq() before it could be initialized by gpiochip_add_irqchip(). This resulted in Kernel NULL pointer dereference. Following are the logs for reference :- kernel: Call Trace: kernel: gpiod_to_irq+0x53/0x70 kernel: acpi_dev_gpio_irq_get_by+0x113/0x1f0 kernel: i2c_acpi_get_irq+0xc0/0xd0 kernel: i2c_device_probe+0x28a/0x2a0 kernel: really_probe+0xf2/0x460 kernel: RIP: 0010:gpiochip_to_irq+0x47/0xc0 To avoid such scenarios, restrict usage of GPIO chip irq members before they are completely initialized. The Linux kernel CVE team has assigned CVE-2022-49072 to this issue. Affected and fixed versions =========================== Fixed in 5.10.111 with commit 7e88a50704b0c49ad3f2d11e8b963341cf68a89f Fixed in 5.15.34 with commit 0912cf021fb5749372b3782611d8b1de4986c13a Fixed in 5.16.20 with commit 2c1fa3614795e2b24da1ba95de0b27b8f6ea4537 Fixed in 5.17.3 with commit f8dea54f74cae8c2e4d7b2952e8fed7743a85c87 Fixed in 5.18 with commit 5467801f1fcbdc46bc7298a84dbf3ca1ff2a7320 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-2022-49072 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/gpio/gpiolib.c include/linux/gpio/driver.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/7e88a50704b0c49ad3f2d11e8b963341cf68a89f https://git.kernel.org/stable/c/0912cf021fb5749372b3782611d8b1de4986c13a https://git.kernel.org/stable/c/2c1fa3614795e2b24da1ba95de0b27b8f6ea4537 https://git.kernel.org/stable/c/f8dea54f74cae8c2e4d7b2952e8fed7743a85c87 https://git.kernel.org/stable/c/5467801f1fcbdc46bc7298a84dbf3ca1ff2a7320