Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8128680imu; Tue, 4 Dec 2018 03:30:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSpxCmLUIEncMhMpoB2B3waRLyQILqr2U3384EMIvYUnKtYekGU0h0pQ2CVlkRkX14Pfdk X-Received: by 2002:a63:c141:: with SMTP id p1mr16413256pgi.424.1543923028872; Tue, 04 Dec 2018 03:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923028; cv=none; d=google.com; s=arc-20160816; b=qRgI+2oMW6nmAk3L/NgK6/SDI5G70Rp7kZ8ZxFzf908+iRYwBEO+kM0E3CSRM+55/6 f0LkQukvlU/hQlKL+NHkl8qkPdtbdZZ/SnxioywQmBva3kyAU/CVtkEVLvd7cavZGXv9 dBGYdHLGw4Pzx5QxIkBxrfhwnEDiIFPVmS3py/ZGtvybPofWh87gSxT6Z/uaNLQ93oug 9yY4vXxk1ADfsS8xiLe2THoPYm2s71Br9l4LU+vvLloDhO0fNwzltLFPtfYs1rcYDA7T YXpc73JBwbXzOyO631I+xVRj+dJuJFWFyducwvfWqr/U8SfYyU8q2Ph5fqwJ4eoB/PYv ZE2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L4kRdcGcBXkAeURWxWQ8GWLVeYlQKE3J/qHpDNoSzRE=; b=RsgpmCILVIXa9LSQr4KHkBIlFem8ROrtuknzcZdsdeLJPrxIzDxItSfna6kkNygwo5 PKMlTUBHxvEiX8/uU8lYrz7IYCfVf9KJ1cOSubPW7FK5ZiWqpXVQ/stbdOGULpAoPKpT amf7dhuBvDetp24p/OIY1cK5cf/8t4z6t0e32D60u5xGxjlYwDDIuU4UREUaZrgOfzZP Zep154MVsu7MzYCeLlXkQEOygzbt3GyP/DIlFta6VYugfq8UX51Kyo5q1vDtkXzj0u8b 89x4/g/UPql/ZKuyUrMG8gSeVqI9asFRo8VsHpELPf3QqX5ZtPRUFCa8EhsjSh04sQ4s waFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="m/ItR6a+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si14751952pgg.281.2018.12.04.03.30.13; Tue, 04 Dec 2018 03:30:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="m/ItR6a+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbeLDK5w (ORCPT + 99 others); Tue, 4 Dec 2018 05:57:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:41882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbeLDK5r (ORCPT ); Tue, 4 Dec 2018 05:57:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B656E2146D; Tue, 4 Dec 2018 10:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921067; bh=46VBUqWgoLtTRV+CO4Ke7u1zTn6JuBfAbxegj+VMh+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/ItR6a+2khgwWCzPGAXe/xPqG3t4pJxO+ybo/G9Sd2FbMytbZQnNqwTlS1pt9jTG 11pFvrj/Gmt2pZm2UQrNc+PIjM2F44m5ZASnP2nBhkLRCkHDxWYza7fUXWlgKmbMBo 7ttsHDKvMpmQCgOEgzh5YdkIjr3x/+MccvOhtGxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+a8ef68d71211ba264f56@syzkaller.appspotmail.com, Mark Kanda , Liran Alon , Paolo Bonzini Subject: [PATCH 4.19 066/139] KVM: x86: Fix kernel info-leak in KVM_HC_CLOCK_PAIRING hypercall Date: Tue, 4 Dec 2018 11:49:07 +0100 Message-Id: <20181204103652.761525392@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Liran Alon commit bcbfbd8ec21096027f1ee13ce6c185e8175166f6 upstream. kvm_pv_clock_pairing() allocates local var "struct kvm_clock_pairing clock_pairing" on stack and initializes all it's fields besides padding (clock_pairing.pad[]). Because clock_pairing var is written completely (including padding) to guest memory, failure to init struct padding results in kernel info-leak. Fix the issue by making sure to also init the padding with zeroes. Fixes: 55dd00a73a51 ("KVM: x86: add KVM_HC_CLOCK_PAIRING hypercall") Reported-by: syzbot+a8ef68d71211ba264f56@syzkaller.appspotmail.com Reviewed-by: Mark Kanda Signed-off-by: Liran Alon Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6788,6 +6788,7 @@ static int kvm_pv_clock_pairing(struct k clock_pairing.nsec = ts.tv_nsec; clock_pairing.tsc = kvm_read_l1_tsc(vcpu, cycle); clock_pairing.flags = 0; + memset(&clock_pairing.pad, 0, sizeof(clock_pairing.pad)); ret = 0; if (kvm_write_guest(vcpu->kvm, paddr, &clock_pairing,