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 623912EBB99 for ; Tue, 9 Dec 2025 01:31:16 +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=1765243876; cv=none; b=rzF+6se/VaqMMxohHFKEayX6SCnZ7ERxP8KslDykuc90MgsZD3c+UIfSUz3pYdnS0RxUcKh4ZiLKEd1YeBQV17XXa9qNaLy6FzRnMuDjMnXDP9XrZS2huCYAEJ9iAsqVCcftn1QE2gHJ1wFsi8eenFWjkzEJV0iTyqEZ72Fdjz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765243876; c=relaxed/simple; bh=XkHFvwBYtL8jOYKgzyvB1C13HVxsX53ebaO6L2JG0Lo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LbEHS6nV0Wx8itbq5SxpWyadusnk66rQv4NxaLLTNriaTfrJwrqAjbkImawNAli7KPlVmtTdwCv9Ap/TdoT999ds4U8tpfPYjxU0AwnAN8CBZH/+JoA+XbmkhWvSKmEVU74zdU4x0SPoJdicVQTLv92rXaxnnbUJday+OsMi1rc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nIHljFEH; 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="nIHljFEH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9063C4CEF1; Tue, 9 Dec 2025 01:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765243875; bh=XkHFvwBYtL8jOYKgzyvB1C13HVxsX53ebaO6L2JG0Lo=; h=From:To:Cc:Subject:Date:Reply-To:From; b=nIHljFEHzOdj7swDGhWEtmPFOajK8kzvhzrhR2oS948LtkDXmquGDbPZVfX8PhUp7 VCy4rc5mU7Js+J809UdC754Y5OvJagqrxhEK+P2OHGgRYmt1szFaBYxf48tOSYvUus cTyqeLylAhBuMmTUBkeE29qqftz8T0t6L9+rS6DE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50657: riscv: mm: add missing memcpy in kasan_init Date: Tue, 9 Dec 2025 10:30:42 +0900 Message-ID: <2025120941-CVE-2022-50657-6582@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2188; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=DXLg/A0Ry/9uzzPFvoV5sIPA/iiQP5sfxg7IRuk7ooQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1QcjOTau9Nz6Ifqh0LY7vPZpxoalSx+EOkmyt/Y2b D8gfWBGRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzEOp1hrkg61+I+XaHb3f5f Qn83XZ71darGL4b5IVZB796s1HH912l/Kd3iA/cruetaAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: riscv: mm: add missing memcpy in kasan_init Hi Atish, It seems that the panic is due to the missing memcpy during kasan_init. Could you please check whether this patch is helpful? When doing kasan_populate, the new allocated base_pud/base_p4d should contain kasan_early_shadow_{pud, p4d}'s content. Add the missing memcpy to avoid page fault when read/write kasan shadow region. Tested on: - qemu with sv57 and CONFIG_KASAN on. - qemu with sv48 and CONFIG_KASAN on. The Linux kernel CVE team has assigned CVE-2022-50657 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 8fbdccd2b17335e1881a23865e98c63fcc345938 and fixed in 6.0.7 with commit ff0f6becf3a6f817838b6f80a2c9cca43dce0576 Issue introduced in 5.18 with commit 8fbdccd2b17335e1881a23865e98c63fcc345938 and fixed in 6.1 with commit 9f2ac64d6ca60db99132e08628ac2899f956a0ec 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-50657 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/riscv/mm/kasan_init.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/ff0f6becf3a6f817838b6f80a2c9cca43dce0576 https://git.kernel.org/stable/c/9f2ac64d6ca60db99132e08628ac2899f956a0ec