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 609901AB526 for ; Thu, 20 Jun 2024 11:19:12 +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=1718882352; cv=none; b=csYZG6leB4erB+IheqcH8EuKJvl3Jic5uGaz0pg0Z21Rb4lP1v64rNhvsrq3yKsYhQyeZM+gx86mux9h8eKNyEVyPBh+Hd+ISE94lAZI/YpRMP6YPR+/7edWLRWBuAP8WGCNTx9fsjNGdCdFm0jT407Uv2S1/13kIlwZiuNNFfI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882352; c=relaxed/simple; bh=U4UQlf6ULYWP9v5tKosYX8ehToRO0g3cLHsbEQo0WFA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=myowv+ScPQLDXYzRYxvcv4IeXX43JxFlwEjTCHrpREnTxf0Ulx1UfNzY1tTCFt/54zye+33Juu9PaBXr7DZI3GQaHZJDOBfDRZSTewaqfbxIMVYxoyx6IqnSMijMQBOA/5haMVMt3KAtqkXfqspeVHz2DNMt6qzvGzhTVCxKgBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QP2xpVdf; 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="QP2xpVdf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D91C5C2BD10; Thu, 20 Jun 2024 11:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882352; bh=U4UQlf6ULYWP9v5tKosYX8ehToRO0g3cLHsbEQo0WFA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QP2xpVdfyDfqYPOT5HZhA/HzLP2UV2cbPkjd6HreuxDu3VmCfj0vk1pXcwInqwZ3x 77mxR9wsgJTFSrCFzWbDV4hztW+D5i+Z7jMC+y3I1Y6dRlqdvcoG7I8OmwrkZphEpi mL+ZsV2gMxR8SyIFEL3GItuYU+tTV+3fphntqbX0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48762: arm64: extable: fix load_unaligned_zeropad() reg indices Date: Thu, 20 Jun 2024 13:16:42 +0200 Message-ID: <2024062009-CVE-2022-48762-9a17@gregkh> X-Mailer: git-send-email 2.45.2 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=3078; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=U4UQlf6ULYWP9v5tKosYX8ehToRO0g3cLHsbEQo0WFA=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/JVVed55MvKLMw/+y5IXmcw9c+mv2YtsJVaePZtad V2cNzqjI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYStZ1hnt6G9YunFc4LdNm1 PmWxZ3i6Dc9FU4Z5pqxXo9Tr5onNFL6k3/GvRa3hifgBAA== 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: arm64: extable: fix load_unaligned_zeropad() reg indices In ex_handler_load_unaligned_zeropad() we erroneously extract the data and addr register indices from ex->type rather than ex->data. As ex->type will contain EX_TYPE_LOAD_UNALIGNED_ZEROPAD (i.e. 4): * We'll always treat X0 as the address register, since EX_DATA_REG_ADDR is extracted from bits [9:5]. Thus, we may attempt to dereference an arbitrary address as X0 may hold an arbitrary value. * We'll always treat X4 as the data register, since EX_DATA_REG_DATA is extracted from bits [4:0]. Thus we will corrupt X4 and cause arbitrary behaviour within load_unaligned_zeropad() and its caller. Fix this by extracting both values from ex->data as originally intended. On an MTE-enabled QEMU image we are hitting the following crash: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Call trace: fixup_exception+0xc4/0x108 __do_kernel_fault+0x3c/0x268 do_tag_check_fault+0x3c/0x104 do_mem_abort+0x44/0xf4 el1_abort+0x40/0x64 el1h_64_sync_handler+0x60/0xa0 el1h_64_sync+0x7c/0x80 link_path_walk+0x150/0x344 path_openat+0xa0/0x7dc do_filp_open+0xb8/0x168 do_sys_openat2+0x88/0x17c __arm64_sys_openat+0x74/0xa0 invoke_syscall+0x48/0x148 el0_svc_common+0xb8/0xf8 do_el0_svc+0x28/0x88 el0_svc+0x24/0x84 el0t_64_sync_handler+0x88/0xec el0t_64_sync+0x1b4/0x1b8 Code: f8695a69 71007d1f 540000e0 927df12a (f940014a) The Linux kernel CVE team has assigned CVE-2022-48762 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 753b32368705 and fixed in 5.16.5 with commit 47fe7a1c5e3e Issue introduced in 5.16 with commit 753b32368705 and fixed in 5.17 with commit 3758a6c74e08 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-48762 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: arch/arm64/mm/extable.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/47fe7a1c5e3e011eeb4ab79f2d54a794fdd1c3eb https://git.kernel.org/stable/c/3758a6c74e08bdc15ccccd6872a6ad37d165239a