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 314EE1AB37B for ; Thu, 20 Jun 2024 11:18:28 +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=1718882308; cv=none; b=iplmXeDFTVjvBEdwckmQAPV5s4zSqC2hqL+WS/iYn2kX7hG7Xi1pByLZjCAcmuV1AEzljoFrHLjD2Kq7ShFTFA8HHFUjuc3SHmHUyULhVcpIrooBLT1pDjOJlxywBEGCTS96MbUafGBkAt9JdwdrI0QSSS50nOF8NnEFXIu5kA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882308; c=relaxed/simple; bh=oWIq4R0EU21nMSXP170MvSqP9W6iO9eShRiDNmfDFIE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OjToysDiKHfvah1PEmDQ0U2q9TW+UO1J4Wguzd/Vvzm8RXJVzhRKMO1UNLPTQgXNLJqfjuvGQcxqizZTO+lhsna+8FKIVVbJsFhvCv1sMUp6pucIM6GcxciCsSS/gdcwfxX36PlEvG7ChKu2dw81Uhdn9V/0UKctWrNDzFF4bP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mmrrw5x2; 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="mmrrw5x2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6AB8C2BD10; Thu, 20 Jun 2024 11:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882308; bh=oWIq4R0EU21nMSXP170MvSqP9W6iO9eShRiDNmfDFIE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mmrrw5x2/goZhvQlZ3AiP8kJ8oBQpwDpc0Xs62r7rp2hRSqaCq8yoetkOkn66w/OE eRUNKHbxHyUFIvh5G9c6iZMreqQv6wq7DoD6gSQZIGzDIcSDPQMQ71WPocN5nd1qu+ tIJZ5S3mwQtTWXzdQS16Os3j+LxYP3NGKkesDElA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48764: KVM: x86: Free kvm_cpuid_entry2 array on post-KVM_RUN KVM_SET_CPUID{,2} Date: Thu, 20 Jun 2024 13:16:44 +0200 Message-ID: <2024062009-CVE-2022-48764-6de1@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=3091; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oWIq4R0EU21nMSXP170MvSqP9W6iO9eShRiDNmfDFIE=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/JXTP3dlFQQuLglUUHkQeyTi6dOJxRPeaBhe+rvUs 3wDL7dMRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyEbx7Dgi2ub4XuLXPZXp++ +utd9a0ntZ8fk2GYxczSue5102EW7838AcclhV4975F7BAA= 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: KVM: x86: Free kvm_cpuid_entry2 array on post-KVM_RUN KVM_SET_CPUID{,2} Free the "struct kvm_cpuid_entry2" array on successful post-KVM_RUN KVM_SET_CPUID{,2} to fix a memory leak, the callers of kvm_set_cpuid() free the array only on failure. BUG: memory leak unreferenced object 0xffff88810963a800 (size 2048): comm "syz-executor025", pid 3610, jiffies 4294944928 (age 8.080s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 ................ 47 65 6e 75 6e 74 65 6c 69 6e 65 49 00 00 00 00 GenuntelineI.... backtrace: [] kmalloc_node include/linux/slab.h:604 [inline] [] kvmalloc_node+0x3e/0x100 mm/util.c:580 [] kvmalloc include/linux/slab.h:732 [inline] [] vmemdup_user+0x22/0x100 mm/util.c:199 [] kvm_vcpu_ioctl_set_cpuid2+0x8f/0xf0 arch/x86/kvm/cpuid.c:423 [] kvm_arch_vcpu_ioctl+0xb99/0x1e60 arch/x86/kvm/x86.c:5251 [] kvm_vcpu_ioctl+0x4ad/0x950 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4066 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:874 [inline] [] __se_sys_ioctl fs/ioctl.c:860 [inline] [] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:860 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x44/0xae The Linux kernel CVE team has assigned CVE-2022-48764 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16.3 with commit 24e7590c60aa and fixed in 5.16.5 with commit b9ee734a14bb 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-48764 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/x86/kvm/cpuid.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/b9ee734a14bb685b2088f2176d82b34cb4e30dbc https://git.kernel.org/stable/c/811f95ff95270e6048197821434d9301e3d7f07c