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 E57A9211A3D for ; Thu, 27 Mar 2025 14:59:05 +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=1743087546; cv=none; b=BGm3saoW94u4CNZIR2d4IFpFjXw/SgyluKLj4tyFay2YF282MhzY9Qzxg8N1oSsJLq9NS367hlobVxnTmTO02hH9+sMdBZ1Xex9GZjE+/P0kSJQic5ffC8ftX4go7bVvjFZVmQp2Peyes7m/SOMmKM3LJOb4jRcXkdRJ1jhQClM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743087546; c=relaxed/simple; bh=i8WaNeSz2w7f6YCf9bQXfqYRa1YjdH7t87jrK06YYHI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GvK19CF9w/eZolzz6mcV8NHHEHLqsg1xNDZZRuK32YvSICsD6vyP1EynJSUNKfyBSh2v2qN7wHu1ajDl8dSDqKf+W5LfHZrY6+P5F8F6uczIHOC6MMy88yGMBib1v9AaXGmGDFay3M4MO3dkni0dJzYRe8v/hpDa8X7zomcXtSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KyTrJJVt; 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="KyTrJJVt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 546DBC4CEDD; Thu, 27 Mar 2025 14:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743087545; bh=i8WaNeSz2w7f6YCf9bQXfqYRa1YjdH7t87jrK06YYHI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=KyTrJJVtrdHOW3MI01rqQgIhkWichOaZXdHIh5ZyR5QTsQW8f1NKPZs5i9sqHysdO zdl2gcrbJbhLvbHOQJQb79zf4SNGoOnfygTnklGh0hX157Z6UKrVPYjk1TFsFBS9xS 0lIsUbr2ncVL0DsyHx5JAHk78QaoJFL4Jybi2fWE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21889: perf/core: Add RCU read lock protection to perf_iterate_ctx() Date: Thu, 27 Mar 2025 15:58:23 +0100 Message-ID: <2025032714-CVE-2025-21889-0913@gregkh> X-Mailer: git-send-email 2.49.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=3184; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=i8WaNeSz2w7f6YCf9bQXfqYRa1YjdH7t87jrK06YYHI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlP09t6wuedm6fnt7pgdd7zSbJ7MgS7Ck3+p6r/PK4er 6D2VfZ1RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyEl5Fhwa7mF+d3sSq353QU C8w8f51xmX3NHYYFa4t8Co6Iz+HtDVvlf+D/ja+PWJY+AAA= 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: perf/core: Add RCU read lock protection to perf_iterate_ctx() The perf_iterate_ctx() function performs RCU list traversal but currently lacks RCU read lock protection. This causes lockdep warnings when running perf probe with unshare(1) under CONFIG_PROVE_RCU_LIST=y: WARNING: suspicious RCU usage kernel/events/core.c:8168 RCU-list traversed in non-reader section!! Call Trace: lockdep_rcu_suspicious ? perf_event_addr_filters_apply perf_iterate_ctx perf_event_exec begin_new_exec ? load_elf_phdrs load_elf_binary ? lock_acquire ? find_held_lock ? bprm_execve bprm_execve do_execveat_common.isra.0 __x64_sys_execve do_syscall_64 entry_SYSCALL_64_after_hwframe This protection was previously present but was removed in commit bd2756811766 ("perf: Rewrite core context handling"). Add back the necessary rcu_read_lock()/rcu_read_unlock() pair around perf_iterate_ctx() call in perf_event_exec(). [ mingo: Use scoped_guard() as suggested by Peter ] The Linux kernel CVE team has assigned CVE-2025-21889 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.6.81 with commit f390c2eea571945f357a2d3b9fcb1c015767132e Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.12.18 with commit a2475ccad6120546ea45dbcd6cd1f74dc565ef6b Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.13.6 with commit dd536566dda9a551fc2a2acfab5313a5bb13ed02 Issue introduced in 6.2 with commit bd27568117664b8b3e259721393df420ed51f57b and fixed in 6.14 with commit 0fe8813baf4b2e865d3b2c735ce1a15b86002c74 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-2025-21889 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: kernel/events/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/f390c2eea571945f357a2d3b9fcb1c015767132e https://git.kernel.org/stable/c/a2475ccad6120546ea45dbcd6cd1f74dc565ef6b https://git.kernel.org/stable/c/dd536566dda9a551fc2a2acfab5313a5bb13ed02 https://git.kernel.org/stable/c/0fe8813baf4b2e865d3b2c735ce1a15b86002c74