From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D68119D07E for ; Fri, 17 Jan 2025 17:22:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737134546; cv=none; b=etj/L6MvpQuei0alTk06JMvUANARuZBwP/NlU+KeBV1MRcvk0IJeDLYA2MAUSY+B02oaz8i17P9Gxe/TH6BX6UJAMCgiyRCZzQpS19rVL1kaCGwGl5QrkvLV9ektEYbBybww/0u1cRr8/NxETxbYuJkeGUk2NxIWDmUjad2D+zI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737134546; c=relaxed/simple; bh=ko9hCfsTSFb2WHMPF+cKB91E3qzU/D2w3rNbjhFfpKM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CjKIsm31JHA31/xJAPbL+Cm1yBfnbCY8V1Qg2LhirHOQlzuR6W/NU03wf/5Rjz7+Nm9P7mcHSnHCAXQ82XTgSwJoSaWMPXIDyeUILHvMth2wWxrUQmyUoxMlOvOnZa4WQdp9/6AQBRG4XneUWbA3gtWDXQxXt1veBxmJZdseJNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bV8/BurP; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bV8/BurP" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ef9864e006so6495346a91.2 for ; Fri, 17 Jan 2025 09:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737134544; x=1737739344; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=y5yk6XYlrmxggOwgGYss86c4m0CiH1dj4p5ycYrzVkE=; b=bV8/BurPZrCL3AWjCubHzQP1njEqjENqILQeP3qlZal4+FZzVzv5zLzeTvOs/RHmN6 mJX18+00FCTs/l3P43/JtBjsak6/ngaABFz/pqtWnsjsO/oFF3t/esliUv3XzLY9IHNZ +EGagopIjg7sbqs7/nzF7q4izAabMNc9Ve55tYs0qT3sW21x+tsEMnGPDEEVfKCGGz9h cE04v+wN8xXqBMHi9oZ9fAaXE9p8ThRPR4lJ5tjCTTtFabm3JqSz2PhRGn22UF26ttz+ mxg4XN4wCcJ+RU3H5zCKf3a02zo/Ae7T3+15xswzRmQZaFdL2x2vrEkGHfu20xBpv7Wi BxCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737134544; x=1737739344; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=y5yk6XYlrmxggOwgGYss86c4m0CiH1dj4p5ycYrzVkE=; b=NU+ewt+ucuJ3D9yAUt2gdCa8s5EfxhsqCzGS+gFlh3vZP118O/XRaazMXhNXFh1KpP oJXXdLy7/j0006hsBhtt1xmwWtZ3QmBMKYTEWrVkLI4NzrskRny4lZpdtLsMcgkVFvMG GBBe5kg4AdRqGr81aEDzf76dzoFCmq9PRd/LQwBIojBM7rpwRbs0d3sgy10eKK+vJtU+ A6m8/x/u1xz01R0oF9VEWDus8VQYF7P4wtNgqrpXdcqGexEo8I+LBkOGrW85NV2tS9t5 N1OJvRoO2sWJr8AVAy++65hArodPy0ZolEWWxpPFjjAss19aHdb6X8Ee+HVHyMcT657j z6ZQ== X-Forwarded-Encrypted: i=1; AJvYcCV89DuiqNvaPw8nkjp2IT8HGBMh0gqKK3gJGNC35Ljl5YbxmAZ8UVLgWdveCYW9ZN+7DqZ7W+Itt0YQ7Qs=@vger.kernel.org X-Gm-Message-State: AOJu0YzjkAmWxPmw0vWTz78mhqAlPkyq+Hl7tG0lZjZRKRP18cBJlfKn eS6Qbtl0+XDIV/62BqeGSSAFx10UBLG/uZYZ0WMrMkTphtIhWqtIc7kKe8avDIjxdIerhRdw80Q VAA== X-Google-Smtp-Source: AGHT+IEj4uiPctq7slvj0cP2L7ciHNWjI6UojppWmGeB2efD/NJZSfjTA0khj4pTOu7zfYI+CZA6d69DOVM= X-Received: from pjuw16.prod.google.com ([2002:a17:90a:d610:b0:2ef:eb2f:ebe]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2f50:b0:2ee:fdf3:38ea with SMTP id 98e67ed59e1d1-2f782d32c45mr4116213a91.23.1737134544351; Fri, 17 Jan 2025 09:22:24 -0800 (PST) Date: Fri, 17 Jan 2025 09:22:22 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <2025011646-chariot-revision-5753@gregkh> Message-ID: Subject: Re: Potential Denial-of-Service Vulnerability in KVM When Emulating 'hlt' Instruction in L2 Guests From: Sean Christopherson To: C CHI Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Dropping Non-KVM folks/lists. On Fri, Jan 17, 2025, C CHI wrote: > I roughly understand the above content. Heh, you top posted, so it's below. https://people.kernel.org/tglx/notes-about-netiquette > The main reason for this phenomenon seems to be the chaotic VM memory lay= out > caused by the syzkaller template settings. In fact, it=E2=80=99s even obs= ervable that > the IDT region in the code doesn=E2=80=99t actually contain any exception= handling > code, very amusing :) >=20 > Additionally, I would like to ask about the previously mentioned point > where the IDT is set in the emulated MMIO space. How can I verify > this, and where can I find the relevant code for setting the MMIO > region? In KVM, any guest address that isn't covered by a memslot, a.k.a. a user me= mory region, is treated as emulated MMIO. > The guest loops because the the guest's IDT is located in emulated > MMIO space, > and as suspected above, KVM refuses to emulates HLT for L2. >=20 >=20 > Also, I'm curious as to what technique is used to get the following > type of logging information, and I'd like to be able to get each ENTRY > and EXIT info on the run The below comes from KVM's tracepoints. E.g. if tracefs is mounted at /sys/kernel/debug/trace, all KVM tracepoints can be enabled via: /sys/kernel/debug/tracing/events/kvm/enable See Documentation/trace/tracepoints.rst for details on using tracepoints (o= r the same info in the web version https://docs.kernel.org/trace/tracepoints.html= ).