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 BFD051A4F2D for ; Wed, 26 Feb 2025 01:58: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=1740535127; cv=none; b=m6EHfAgpWosPZEgknMvVUFTd8zdiNApwT2Rdjh4uwgUrD+wEWxfNObJMXQvitsxu35Y8ZhRDeYHN/ELvuJCS6na7jszQKOIWyXn6T+e9NTynffTqYaZO2R4TGUeiUELGmxbgfkkBwyJJE0DO0G0Vm/NXEB0E7xrPK4k3Z6AO7GI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535127; c=relaxed/simple; bh=oD0Pd3Fr8NCgLqlMQ75U15vRjIXGrF7741WSJ1veh/w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fJ2diTDjIk0FaKxfdNW085ErPZVh4QO6XwsGbJGlIMLkzoWqKzy4x4K1JP3gVK6nhugBr1SybpfT+NXq6ZheRSeuIhXUf44jR3X0Lb9PqrXgdzPrwenc3JxJeGMJIO7/T545+oMaE28R0ju4wGoSWuyRMiYakA14flS9SrjCM9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z9lBEZPs; 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="z9lBEZPs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9448EC4CEDD; Wed, 26 Feb 2025 01:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535127; bh=oD0Pd3Fr8NCgLqlMQ75U15vRjIXGrF7741WSJ1veh/w=; h=From:To:Cc:Subject:Date:Reply-to:From; b=z9lBEZPsXx4tiF7L2dWXSOdmGCALp1Dxb6zsahhFYEswTyPO4O15aNYB355fKvhQb 6OzeQAJ2eYZ7Xmu1DvOIV7Cjt0VEfO+LdV40Ml00i36J4NPy1oE2Js/ZR0mOYlrrLx +XP45Ku24fTHkpbUPd8w9jnPBYzHpsDZ6iIeMA0U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49146: virtio: use virtio_device_ready() in virtio_device_restore() Date: Wed, 26 Feb 2025 02:55:51 +0100 Message-ID: <2025022608-CVE-2022-49146-60f4@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=3529; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oD0Pd3Fr8NCgLqlMQ75U15vRjIXGrF7741WSJ1veh/w=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7ShyiZki18h6wVBP0f6gd2FdvUODNsj8xY1dHYuvS2 7kVPfkdsSwMgkwMsmKKLF+28RzdX3FI0cvQ9jTMHFYmkCEMXJwCMJFXRxjmWfS2qO1zbGa08rW/ 0ceqse6r7oQehnn6Ml9qmeMcH5xyvep/6+P5cO7uVg8A 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: virtio: use virtio_device_ready() in virtio_device_restore() After waking up a suspended VM, the kernel prints the following trace for virtio drivers which do not directly call virtio_device_ready() in the .restore: PM: suspend exit irq 22: nobody cared (try booting with the "irqpoll" option) Call Trace: dump_stack_lvl+0x38/0x49 dump_stack+0x10/0x12 __report_bad_irq+0x3a/0xaf note_interrupt.cold+0xb/0x60 handle_irq_event+0x71/0x80 handle_fasteoi_irq+0x95/0x1e0 __common_interrupt+0x6b/0x110 common_interrupt+0x63/0xe0 asm_common_interrupt+0x1e/0x40 ? __do_softirq+0x75/0x2f3 irq_exit_rcu+0x93/0xe0 sysvec_apic_timer_interrupt+0xac/0xd0 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch_cpu_idle+0x12/0x20 default_idle_call+0x39/0xf0 do_idle+0x1b5/0x210 cpu_startup_entry+0x20/0x30 start_secondary+0xf3/0x100 secondary_startup_64_no_verify+0xc3/0xcb handlers: [<000000008f9bac49>] vp_interrupt [<000000008f9bac49>] vp_interrupt Disabling IRQ #22 This happens because we don't invoke .enable_cbs callback in virtio_device_restore(). That callback is used by some transports (e.g. virtio-pci) to enable interrupts. Let's fix it, by calling virtio_device_ready() as we do in virtio_dev_probe(). This function calls .enable_cts callback and sets DRIVER_OK status bit. This fix also avoids setting DRIVER_OK twice for those drivers that call virtio_device_ready() in the .restore. The Linux kernel CVE team has assigned CVE-2022-49146 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit d50497eb4e554e1f0351e1836ee7241c059592e6 and fixed in 5.16.19 with commit 94e9f5da39ee5f8ea31be1585de31c54f10dedce Issue introduced in 5.16 with commit d50497eb4e554e1f0351e1836ee7241c059592e6 and fixed in 5.17.2 with commit 4ae431113179d72c668b61df320af0c06d1aa5c5 Issue introduced in 5.16 with commit d50497eb4e554e1f0351e1836ee7241c059592e6 and fixed in 5.18 with commit 8d65bc9a5be3f23c5e2ab36b6b8ef40095165b18 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-49146 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/virtio/virtio.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/94e9f5da39ee5f8ea31be1585de31c54f10dedce https://git.kernel.org/stable/c/4ae431113179d72c668b61df320af0c06d1aa5c5 https://git.kernel.org/stable/c/8d65bc9a5be3f23c5e2ab36b6b8ef40095165b18