From mboxrd@z Thu Jan 1 00:00:00 1970 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 E85531C287 for ; Thu, 22 Aug 2024 03:34:22 +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=1724297663; cv=none; b=jUAmXaLwbeALGXtbaACsEqxeYXz4FWF1dYJi3iFU3iwBaFljO4MZACQoKDeQkRY/gnZxBGTJ/hZ31yLP0h83lc6KZMPLIQ13IabT0TaZqJXh6QkNuAXWRDwDPPgMeJLRg3pwkPKuuiykt9a6MT09iIEn25Qy1l16q8eDon8GYbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724297663; c=relaxed/simple; bh=X/t9a0Rz8hv0/vBmfFxsQzgxeUdic3Je1JEQqiHhB1M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WX5GyOjMsHnMjMg/WLNZl6lIgIQBPZyG9QGLY4/y5f1B7vi0x/pZiRdWVFF2lQ9f9FExSqOz6azffFNkAqdRkGgQSpk1Qod6DW6Xov30GOrcyc4C5wHhdri1UrCtadmkGXLK42hOSRA8laaWafnuVyWrbuH1q/RwYk8F6q1z+1w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mIn5E3d6; 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="mIn5E3d6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75E88C4AF0B; Thu, 22 Aug 2024 03:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724297662; bh=X/t9a0Rz8hv0/vBmfFxsQzgxeUdic3Je1JEQqiHhB1M=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mIn5E3d6QStvgy1mNkIY5buoc6QYy4Z9pDlGKyd/lSJyBqvODTPA8xwZbtrkURi+4 6I+r/RzBo8amV6Hjlxo8fIZoGhhTyqY90+HPKeVH4fDh+thpw9mvainBpsn1rnmHdu KfqnUjqFSzJbJjh52KOgLW69WVtc3sWzszdQDjyk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48942: hwmon: Handle failure to register sensor with thermal zone correctly Date: Thu, 22 Aug 2024 11:31:43 +0800 Message-ID: <2024082227-CVE-2022-48942-ca91@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=3887; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=X/t9a0Rz8hv0/vBmfFxsQzgxeUdic3Je1JEQqiHhB1M=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnHNvK/fWZruungjpcrlA54/uI8oLyiQ+2kU7/ojW1xM yt5J9Zd6IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJMFQyzM/OPRaRelar8sKp Z9pu85ZLJhVqr2KYH7Fl3xpB4XMnzvB22jwK8pkp5X3uIwA= 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: hwmon: Handle failure to register sensor with thermal zone correctly If an attempt is made to a sensor with a thermal zone and it fails, the call to devm_thermal_zone_of_sensor_register() may return -ENODEV. This may result in crashes similar to the following. Unable to handle kernel NULL pointer dereference at virtual address 00000000000003cd ... Internal error: Oops: 96000021 [#1] PREEMPT SMP ... pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mutex_lock+0x18/0x60 lr : thermal_zone_device_update+0x40/0x2e0 sp : ffff800014c4fc60 x29: ffff800014c4fc60 x28: ffff365ee3f6e000 x27: ffffdde218426790 x26: ffff365ee3f6e000 x25: 0000000000000000 x24: ffff365ee3f6e000 x23: ffffdde218426870 x22: ffff365ee3f6e000 x21: 00000000000003cd x20: ffff365ee8bf3308 x19: ffffffffffffffed x18: 0000000000000000 x17: ffffdde21842689c x16: ffffdde1cb7a0b7c x15: 0000000000000040 x14: ffffdde21a4889a0 x13: 0000000000000228 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000001120000 x7 : 0000000000000001 x6 : 0000000000000000 x5 : 0068000878e20f07 x4 : 0000000000000000 x3 : 00000000000003cd x2 : ffff365ee3f6e000 x1 : 0000000000000000 x0 : 00000000000003cd Call trace: mutex_lock+0x18/0x60 hwmon_notify_event+0xfc/0x110 0xffffdde1cb7a0a90 0xffffdde1cb7a0b7c irq_thread_fn+0x2c/0xa0 irq_thread+0x134/0x240 kthread+0x178/0x190 ret_from_fork+0x10/0x20 Code: d503201f d503201f d2800001 aa0103e4 (c8e47c02) Jon Hunter reports that the exact call sequence is: hwmon_notify_event() --> hwmon_thermal_notify() --> thermal_zone_device_update() --> update_temperature() --> mutex_lock() The hwmon core needs to handle all errors returned from calls to devm_thermal_zone_of_sensor_register(). If the call fails with -ENODEV, report that the sensor was not attached to a thermal zone but continue to register the hwmon device. The Linux kernel CVE team has assigned CVE-2022-48942 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 1597b374af22 and fixed in 5.10.103 with commit 962b2a3188bf Issue introduced in 5.8 with commit 1597b374af22 and fixed in 5.15.26 with commit 7efe8499cb90 Issue introduced in 5.8 with commit 1597b374af22 and fixed in 5.16.12 with commit 8a1969e14ad9 Issue introduced in 5.8 with commit 1597b374af22 and fixed in 5.17 with commit 1b5f517cca36 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-48942 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/hwmon/hwmon.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/962b2a3188bfa5388756ffbc47dfa5ff59cb8011 https://git.kernel.org/stable/c/7efe8499cb90651c540753f4269d2d43ede14223 https://git.kernel.org/stable/c/8a1969e14ad93663f9a3ed02ccc2138da9956a0e https://git.kernel.org/stable/c/1b5f517cca36292076d9e38fa6e33a257703e62e