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 7AFA6481A3 for ; Wed, 1 May 2024 05:31:56 +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=1714541516; cv=none; b=Cn4DoVPqBT/icaHrmM29z8zlHoaxgMOb9fm5lZVFNFKipSR3PxG7tHKrzodCaQ6pZYllIL197NFc8b/h0bV7XWyYjFqa0yvNZqyNujM107CWLE1LddUjVEJmJTr4t/t0FqtI9CpkjjZ76jzfwNz66AsBMxu9aw0ss8nHn1dvaAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541516; c=relaxed/simple; bh=WGcPTB/lzWImuB6xuJvLjZbblL/gODsvUJeuReW0roE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sZen7gL5ntOV+msnWqo8MGAEgG/juM9zHmcZTOzT6nubApaZSjHvBk9dT250ljD7AQO6UeXtjwIKVJllKW+A+DmJ4G9Uddakl9I0NqM1ddyF+gAn+XGMHlxKMmJ2jMlp8W5CHr70IsWd6UMs8iO+9E8v2hZ8POfgSH2gN8AI3L0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SaUQWV9F; 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="SaUQWV9F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04DC0C113CC; Wed, 1 May 2024 05:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714541516; bh=WGcPTB/lzWImuB6xuJvLjZbblL/gODsvUJeuReW0roE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SaUQWV9FYcIU3OytpGhu6LOmLFOZWedqIvUPaGQi5tvfijTXAbR/g4i7j69VB9rfA XjQbif30hz6d/B3rXx0E+jEMieZWESqVMAu4pvIIUfYH4NaGq07kL6m3NtAHa+dfbv y1DDzlzjtekeYe+NSFFo7ljyc7i3Vz4YO8m6aLLE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-27005: interconnect: Don't access req_list while it's being manipulated Date: Wed, 1 May 2024 07:31:06 +0200 Message-ID: <2024050147-CVE-2024-27005-e630@gregkh> X-Mailer: git-send-email 2.44.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=3889; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=WGcPTB/lzWImuB6xuJvLjZbblL/gODsvUJeuReW0roE=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmGl9ujN6x26Yvc63YpIeFSlTzvMwt/Z6Vbi/mv26hPs WVY+6yzI4aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbiuZVhxj/r/Ef/Pze2tMu9 DpmqfOPTNYvnDHOFpVhPfNu/w+23rqqrcYMtj+s/e0MA 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: interconnect: Don't access req_list while it's being manipulated The icc_lock mutex was split into separate icc_lock and icc_bw_lock mutexes in [1] to avoid lockdep splats. However, this didn't adequately protect access to icc_node::req_list. The icc_set_bw() function will eventually iterate over req_list while only holding icc_bw_lock, but req_list can be modified while only holding icc_lock. This causes races between icc_set_bw(), of_icc_get(), and icc_put(). Example A: CPU0 CPU1 ---- ---- icc_set_bw(path_a) mutex_lock(&icc_bw_lock); icc_put(path_b) mutex_lock(&icc_lock); aggregate_requests() hlist_for_each_entry(r, ... hlist_del(... Example B: CPU0 CPU1 ---- ---- icc_set_bw(path_a) mutex_lock(&icc_bw_lock); path_b = of_icc_get() of_icc_get_by_index() mutex_lock(&icc_lock); path_find() path_init() aggregate_requests() hlist_for_each_entry(r, ... hlist_add_head(... Fix this by ensuring icc_bw_lock is always held before manipulating icc_node::req_list. The additional places icc_bw_lock is held don't perform any memory allocations, so we should still be safe from the original lockdep splats that motivated the separate locks. [1] commit af42269c3523 ("interconnect: Fix locking for runpm vs reclaim") The Linux kernel CVE team has assigned CVE-2024-27005 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit af42269c3523 and fixed in 6.6.29 with commit d0d04efa2e36 Issue introduced in 6.6 with commit af42269c3523 and fixed in 6.8.8 with commit 4c65507121ea Issue introduced in 6.6 with commit af42269c3523 and fixed in 6.9-rc5 with commit de1bf25b6d77 Issue introduced in 5.15.133 with commit 9be2957f014d Issue introduced in 5.15.151 with commit fe549d8e9763 Issue introduced in 6.1.55 with commit ee42bfc791aa Issue introduced in 6.1.81 with commit 19ec82b3cad1 Issue introduced in 6.5.5 with commit 2f3a124696d4 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-27005 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/interconnect/core.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/d0d04efa2e367921654b5106cc5c05e3757c2b42 https://git.kernel.org/stable/c/4c65507121ea8e0b47fae6d2049c8688390d46b6 https://git.kernel.org/stable/c/de1bf25b6d771abdb52d43546cf57ad775fb68a1