Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp619684rdb; Thu, 8 Feb 2024 16:23:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbJvdyNvgL0G7gC9VH15c4JQNMpGXLFDrcdecdsSweT0VS35lgm9K+Rhp95mnbMSskzMmP2jlMxMfPJWvqe3h9yTlyx91w5tM0qN4maQ== X-Google-Smtp-Source: AGHT+IGcFPovcZcJ5iMbF8dg/l/+GwBbgjCiYc8hMzXybRhOiLiwyruIE05EtgYFGgk5AOJJdcfw X-Received: by 2002:a05:620a:40c3:b0:785:9e3c:20c5 with SMTP id g3-20020a05620a40c300b007859e3c20c5mr118253qko.6.1707438214310; Thu, 08 Feb 2024 16:23:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707438214; cv=pass; d=google.com; s=arc-20160816; b=RlUYvscFueYuuo+mfbJDbVFttFRTf6p9a/bcLhpLs60ug48ft8/ETLYWg1AoGHOk/f jn2ememCn5BR/SKj51Cy6g9X6FAVtOr1QPQDAxUqvNcEHDxNGErzPQsif9ybhSsfcODT MPAgurQ8VcjyyLoOjQNOhI85hhYi9KL4c+k2wFBBLu40Oyyjwt4ZGsInAx6pzCS/7aTp Cb1OBmdkCAAtNAdyROtLV8Adu5HvTR6T/XY6v3HcpRvTXo+RBkX6xRhv83EVVeu5ibUv D3fWhQUH8wzdHbV3gVByWB/8kVgXLyScFYZaGUK5jyyX/vkEFNAnBlp6ANYWKMg4qpYy 0izQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=UH+g3qEUJZAlImoFuBdFiY+nZlSyfmnl7qGyQ8nitY4=; fh=eQZ6ROarvbt6kXqQ9OXfNDkAWEmYKAiMCs8omsq7NFo=; b=V9jxLsm2lrL6sB88poD/dDxH5/m17L1CvY/+ioyIAjveqlCIYouDv8vzewrE+Azq1L YSujD3XjqRsfcf+vutatBP4GaLG+rmYH/d1FSEinCR+qPHnDrwCu/jkR8pvWf1zusIfb NvcQDV/EQkjKCSIrBxX1W3uO1uz2/cjzg9MlE2gmKp5MxxONn2tJ9coSMtBsriBQmg2S /3ngkt+CtaP9VlbON3648DgiMRKpCD7UiobM8c+4Q2vcMOSRfB6iRo7OCbOVRtiNpsG0 eY6KcOCusCh4sJEFzDAYwj7kAyf01yh/UEBlh+cjjgq8RuE7OvkFupcCL+IT6HbgtUwl fOXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wVxRmnGU; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-58901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVAw3RbPzfjycjKZ2XOeL1/GjhFbGUyZ72IKA47gVFOGCtDOHC3t+tGaZdXoO3NzqQcOmJ6fsae+nV0mFYgH4ybDtc4ldRnFq3qTyzGhw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o13-20020a05620a110d00b0078561bb66c1si745982qkk.726.2024.02.08.16.23.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 16:23:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wVxRmnGU; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-58901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 160B51C22C8F for ; Fri, 9 Feb 2024 00:23:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5F2623CB; Fri, 9 Feb 2024 00:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="wVxRmnGU" 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 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-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