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 459D0217727 for ; Wed, 26 Feb 2025 02:24:02 +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=1740536643; cv=none; b=gntvMcxLm/rSEUfeMLKGwcsXYSofYlR57mrs21uXA/F44YM/kdsDWnmVcbxkQpTSiUuq4iIayjTem6XNL9aapeTJsn6gY01+nN7uLEHxZc/iKM/NLzbRtVO11vzgk+ccF8DO8PqhIUSw21yfctU8NXMUgue3mduSXkfSWX4mL4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536643; c=relaxed/simple; bh=aRS4tDny2nNMsfW7E2HjW9dLPa01VcuFuj83hhPfzbs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RzSj9007INqfAg2WQ1JI33MqLYRS0UQXPs2J6B18p2nF4D0KCXGHPK9ZSdwa+4KaYf/q9J4Z8VlahyO7Hs5eCXqyil64mz13fhvdYDHceQ6GBvRCq88u6d4gKf+kyCMyBaYSN6/r9t99qLwfvtZX03HgKmoISdzxxxFHXBQ+NJ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d1Laqzm4; 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="d1Laqzm4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEB2FC4CEDD; Wed, 26 Feb 2025 02:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536642; bh=aRS4tDny2nNMsfW7E2HjW9dLPa01VcuFuj83hhPfzbs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=d1Laqzm40gdp2ec7llkcG0TCQQoFMctfZl44iAmWBUGWeTta18Gj99qbn+F1vzvvh o00+mQeOYHhLGSSUzKwQ17M2atwAYyVA1ynPsrHcm8JPrpwysyH4FXGippxeswY84B x5d9G8pgPIP+dKtVE+TOf5TApTC2JRccg4ac3M7o= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49568: KVM: Don't null dereference ops->destroy Date: Wed, 26 Feb 2025 03:22:11 +0100 Message-ID: <2025022606-CVE-2022-49568-e2f5@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=2726; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aRS4tDny2nNMsfW7E2HjW9dLPa01VcuFuj83hhPfzbs=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qs5N6BHvnBLceaRnYk/XsksSUvtN2qI1HulySr0X/ Su97INIRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExknz/Dgiln9G6tSK62UhKb aZ9aoCCuP1V+P8P8GrPHU5/ETpOV1hZf+i8l/t7qw4eMAQ== 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: Don't null dereference ops->destroy A KVM device cleanup happens in either of two callbacks: 1) destroy() which is called when the VM is being destroyed; 2) release() which is called when a device fd is closed. Most KVM devices use 1) but Book3s's interrupt controller KVM devices (XICS, XIVE, XIVE-native) use 2) as they need to close and reopen during the machine execution. The error handling in kvm_ioctl_create_device() assumes destroy() is always defined which leads to NULL dereference as discovered by Syzkaller. This adds a checks for destroy!=NULL and adds a missing release(). This is not changing kvm_destroy_devices() as devices with defined release() should have been removed from the KVM devices list by then. The Linux kernel CVE team has assigned CVE-2022-49568 to this issue. Affected and fixed versions =========================== Fixed in 5.4.210 with commit 170465715a60cbb7876e6b961b21bd3225469da8 Fixed in 5.10.134 with commit 3616776bc51cd3262bb1be60cc01c72e0a1959cf Fixed in 5.15.58 with commit e91665fbbf3ccb268b268a7d71a6513538d813ac Fixed in 5.18.15 with commit d4a5a79b780891c5cbdfdc6124d46fdf8d13dba1 Fixed in 5.19 with commit e8bc2427018826e02add7b0ed0fc625a60390ae5 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-49568 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: virt/kvm/kvm_main.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/170465715a60cbb7876e6b961b21bd3225469da8 https://git.kernel.org/stable/c/3616776bc51cd3262bb1be60cc01c72e0a1959cf https://git.kernel.org/stable/c/e91665fbbf3ccb268b268a7d71a6513538d813ac https://git.kernel.org/stable/c/d4a5a79b780891c5cbdfdc6124d46fdf8d13dba1 https://git.kernel.org/stable/c/e8bc2427018826e02add7b0ed0fc625a60390ae5