From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 7D1E2184D for ; Fri, 9 Feb 2024 00:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707438190; cv=none; b=s9USwhNgWif8S8YpxDDVS8RnA51mqtwdU51/Pg7+tBips67RWK0RQxPfFdV5TD5MXwlXkYHlkQ/GMgd6EO+XNtsifkMKSqlDmL4hnEewqekikVq/P0tOLhdoD3YdmYUgeByJYQ7XW5mu1xBiKwiboeNpM4xjZ5kcz00tJk50Wso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707438190; c=relaxed/simple; bh=b9LBD3SzdzjTdTsgPpA3dbIQFJXNZZ9G4M6Su8Fgp5Q=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=g3cl+/RYgb63cyXDy+fFGSTbsGh5sBc3Qrkoc2V5PvVS2bdgdS0oHeeWjcx8VuZdq6HhyooiEQOxM91HqqNOKHwYtcV2mCu3D2vWsUJvddwBlNVB9LP3wBCqiPxLY7GQH/CdFmDwzlGYADOPoAVPnZCOJF16iriCjHaBh9IJDFU= 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=wVxRmnGU; arc=none smtp.client-ip=209.85.219.201 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="wVxRmnGU" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6dbdcfd39so772245276.2 for ; Thu, 08 Feb 2024 16:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707438187; x=1708042987; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=UH+g3qEUJZAlImoFuBdFiY+nZlSyfmnl7qGyQ8nitY4=; b=wVxRmnGU9Uryghp5G35SvHbKmc3MRv2+7lywGg+/9wz9772iMdonf6CutG4e5/Cec1 Py3szzghiFR02ugU1/cpGbBSTclRK960mPSG6g98Du2gxRH+VR6ASk9FZQDBeIxZtFjf A8Abnt01hhF6et5+ND9rxaQu8gdNspylkt39FetokYJ05O349rpcl/w3F2m/8iSYCDgu 5HQwQrAay51VW0iJFyAcx76+V4WcAFxRPicAh15bQSc6tdyF7kPtOS69D7/QeYjAKgrY y5CkmBXHojthAYIRFMPagd9x2o/SGJqmNTM9swQDB7miMo1uQjanxjQE9MkPgyoAz21a RRwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707438187; x=1708042987; h=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=UH+g3qEUJZAlImoFuBdFiY+nZlSyfmnl7qGyQ8nitY4=; b=dfbSWQIFo0l63CA/CsKF/d1d18z4HSbPApG1/9L9NuDk1XEasKO26wNF6zNKdMfMiK GQysM6T5mWK40bHL9Izqh2OXDBGQV2rSM/XIdgkB0BBwPwcxFkr4zzysGgtm5CX54hnr pBVe221o4QE8xjuFhoua3h/38aiuPbnAugTe9GSUg/1KnqU0S+9AGxPSy/6wSBv7UCeS PqmXoO3lnwov7AAD7hZB3x0vc5cyt0em4sPNFeK6Y51OEs3MQg6kWBzqvzOYATBFUVFE tRaWY1WjIPNN8fQ81LCha+Vf5n+MyPNw+siGrtgiIjH6G4jp0/+QLhruXjonCW2XckYF qSEA== X-Forwarded-Encrypted: i=1; AJvYcCVzSOmc8Dl0jjXlER5q0MJPaNoI5IJCGwd7ctf7g7O/AGBxCiPbUioMi2lR26hlVrK6+VOuYO1X51guiq1uf9UltjnPgfKy+HaPkd25 X-Gm-Message-State: AOJu0YyrPSUJ4w8QxVwKSHZFIrM7Jfrzt+E5qTvWDtYDaL7zndpZroBS /VTBTCWLnct2c3Wk8Nu/0vqPxn/L0r5iDVqRunC7oHkFRR7rtfz2HF4dRQ+OAugRACAfRgbZMUG kBA== X-Google-Smtp-Source: AGHT+IHwVRKJ41KsV2QGjN2W8YCEY1g61kAuyb2k6AMMLR0Xpg5dI/8LroMKujPE1IpSfovaE5Tmjc/Jt2g= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:f11:b0:dc6:af9a:8cfa with SMTP id et17-20020a0569020f1100b00dc6af9a8cfamr277411ybb.6.1707438187615; Thu, 08 Feb 2024 16:23:07 -0800 (PST) Date: Thu, 8 Feb 2024 16:22:45 -0800 In-Reply-To: <20231009092054.556935-1-julian.stecklina@cyberus-technology.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231004133827.107-1-julian.stecklina@cyberus-technology.de> <20231009092054.556935-1-julian.stecklina@cyberus-technology.de> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <170743804541.201306.3426133149771301470.b4-ty@google.com> Subject: Re: [PATCH v2 1/2] KVM: x86: Fix partially uninitialized integer in emulate_pop From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Julian Stecklina Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Mon, 09 Oct 2023 11:20:53 +0200, Julian Stecklina wrote: > Most code gives a pointer to an uninitialized unsigned long as dest in > emulate_pop. len is usually the word width of the guest. > > If the guest runs in 16-bit or 32-bit modes, len will not cover the > whole unsigned long and we end up with uninitialized data in dest. > > Looking through the callers of this function, the issue seems > harmless, but given that none of this is performance critical, there > should be no issue with just always initializing the whole value. > > [...] Applied to kvm-x86 misc. I massaged the changelog to make it clear that uninitialized tweaks aren't actually a fix. I also omitted the change from a u32=>unsigned long. The odds of someone copy+pasting em_popa() are lower than the odds of an unnecessary size change causing some goofy error. [1/2] KVM: x86: Clean up partially uninitialized integer in emulate_pop() https://github.com/kvm-x86/linux/commit/6fd1e3963f20 [2/2] KVM: x86: rename push to emulate_push for consistency https://github.com/kvm-x86/linux/commit/64435aaa4a6a -- https://github.com/kvm-x86/linux/tree/next