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 33DE7215F49 for ; Wed, 26 Feb 2025 02:13:47 +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=1740536027; cv=none; b=eom7Ek9OdAa8V0ZslQ4lyEKTYUU723Y/sZCMWhgqPmiMXOxrCCAjAcjhLxa0F75NtdwRV0Nx4wAxFc+n7Ra34SuHR5R2JDHGfI/d6WKDaViL58Od+7XPCrew9NV8hgRWZe3nSR6xTaDy9MCSu7njKBLRGXr8WGgIqpZz3dqcsk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536027; c=relaxed/simple; bh=OYdiB1IZvoSHYIay/wWkowg6cRZ8r8i5GJfshncnSn0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mug+pDnhgWxXxT3BATrFUPJWNttQdDXnyqqk1lkmLXXst8eFBtSmPT5R4jOfcE5OnQ4vsCm+jqQNUfjQKljxGf3s+tq6N0Yme9UCiJ7x32i2jZbmTo4i6808YLpI8XT15C6hJIqWlocpSMxBV5vY0AO4/ySshk6jnrE4NYP7QxY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CDGizaZF; 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="CDGizaZF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1AA7C4CEDD; Wed, 26 Feb 2025 02:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536027; bh=OYdiB1IZvoSHYIay/wWkowg6cRZ8r8i5GJfshncnSn0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CDGizaZFUTO6kQagZkNzLP5M8+y1eY2Sm702wLueWU9b5PxI496EqCHxB4H2+uwM/ DG0DGu9mR2GMNfi3Eo/Ru8ttu0VImN+ZLH/QPgRb3JVJHkD2qeDDB8QjAux7+D9+9J tiBHwQJMHBve6XioYUvbmRkKXaBQhnytD9NdjdtA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49393: misc: fastrpc: fix list iterator in fastrpc_req_mem_unmap_impl Date: Wed, 26 Feb 2025 03:11:07 +0100 Message-ID: <2025022649-CVE-2022-49393-dd81@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=2896; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=OYdiB1IZvoSHYIay/wWkowg6cRZ8r8i5GJfshncnSn0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yt9e6f3euJyr8MvSY1lrbEImrTq5+MRbf8WiFbEvX 83QepjC2RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATMZRjWDDv7GsLpZKGIslF L+QcxN6vXRMmFcAw38XyZeHUrEWGhXtudWod3J/5dPNJFQA= 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: misc: fastrpc: fix list iterator in fastrpc_req_mem_unmap_impl This is another instance of incorrect use of list iterator and checking it for NULL. The list iterator value 'map' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty (in this case, the check 'if (!map) {' will always be false and never exit as expected). To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'map' as a dedicated pointer to point to the found element. Without this patch, Kernel crashes with below trace: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000ffff7fb03750 ... Call trace: fastrpc_map_create+0x70/0x290 [fastrpc] fastrpc_req_mem_map+0xf0/0x2dc [fastrpc] fastrpc_device_ioctl+0x138/0xc60 [fastrpc] __arm64_sys_ioctl+0xa8/0xec invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0xd4/0xfc do_el0_svc+0x28/0x90 el0_svc+0x3c/0x130 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x18c/0x190 Code: 14000016 f94000a5 eb05029f 54000260 (b94018a6) ---[ end trace 0000000000000000 ]--- The Linux kernel CVE team has assigned CVE-2022-49393 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 5c1b97c7d7b736e6439af4f43a65837bc72f56c1 and fixed in 5.18.3 with commit 2d12905aad462383f4e7a5fdb024d2b7ae2d10cf Issue introduced in 5.18 with commit 5c1b97c7d7b736e6439af4f43a65837bc72f56c1 and fixed in 5.19 with commit c5c07c5958cf0c9af6e76813e6de15d42ee49822 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-49393 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/misc/fastrpc.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/2d12905aad462383f4e7a5fdb024d2b7ae2d10cf https://git.kernel.org/stable/c/c5c07c5958cf0c9af6e76813e6de15d42ee49822