Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp627217imu; Fri, 11 Jan 2019 06:26:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN53KQtruJZEQ3VNXjBZTxIBzh+OU9mShss7G1ZQK1RYGiFi/6vcwT2qnDOCE1EU+2DsiFHv X-Received: by 2002:a62:59c9:: with SMTP id k70mr14733842pfj.243.1547216762477; Fri, 11 Jan 2019 06:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547216762; cv=none; d=google.com; s=arc-20160816; b=egGUl1t9ZqEbD64iOIyCH3vTcWG7W5AtlQvuTFiny4ZTf3/h4j3EJXl6nUxheNbj1L XsaYpFDQewHbCbPfs4aYLFcwvv9MYcEFuuHqHgvz4MYQDkd4EmbBawrzpc6VOqeeHuRo ewsT8Kdf95DtB45FJuM63g7pK4QBDQ2YxV5xRButafW4H5/ZzEp+exNHGK7sztOYkXLB wHpfxQRbyeaIfS/jsiK9npDVTIz36Z9+QDKXufF3S2ngm2Dn8m8Tae47G7iAkTCQtS0j e+GbRoEWXv+1KwWEenN05rkdjKz0WwHjp8Cq7p6TY6XFfT5e/dmSTLeAEONANuh4lGBj LDBw== 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=9qiJWrV01R43XNqEbBTPhls/3uGDnxgWu9gtpsxcu7U=; b=ljCusg62cMiqgry9pW1uj6oAXe1kfnW9it/ahFA1ujw6YbZKUgP9ut4bQEVFmw4Ek4 5lgntYc6EQyhLIy75nDFMZtYUiH11qL8W4sT/oINSV8l23t9hVSS3n3VC4AZWwvwiKvz QxHssR1BGFQKbDcpDUCX36JhpUuhLFeCNwZxxxF/l5CvAnTS7qp7/P1yqzsl2EUzgHqc 5tvrHhbW8XJOVAxLZ7ofEk65VjaDL5gt4CDhkovnJXEiPUfdVb8lnX8t0SgacMAWvvnZ 8rYByUSy9UZwo6tZsFSQTOkzIgKxQlE4uMCZYeyPyBbnlsiNp6aLrOJXwL7Lli6kaCzP ibKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JpA77aMH; 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 82si36482898pfa.115.2019.01.11.06.25.47; Fri, 11 Jan 2019 06:26:02 -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=JpA77aMH; 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 S2388111AbfAKOU2 (ORCPT + 99 others); Fri, 11 Jan 2019 09:20:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:38322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfAKOU0 (ORCPT ); Fri, 11 Jan 2019 09:20:26 -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 264232177B; Fri, 11 Jan 2019 14:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216425; bh=fZGKMrCGncoRrVzqwHd4S+4M+qmiRzJVrSsPtIABLks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JpA77aMHZrFCc32ThFnGshjofJnqfWzq6YfGNxQc8BOi8vPsB+0rjIJOZiJh5ttQT /3o00UQzz5xzS3LNsLV5V37xuIRIopp8zI2OrlCMc1rp+uncoE8rnv3salBrF/Becl fKMzkKOIyQO23KK9zEYm35A1WVh26hcj72axIHJY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Hajnoczi , "Michael S. Tsirkin" , Daniel Verkamp Subject: [PATCH 4.4 88/88] vhost/vsock: fix uninitialized vhost_vsock->guest_cid Date: Fri, 11 Jan 2019 15:08:57 +0100 Message-Id: <20190111131100.174148460@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Hajnoczi commit a72b69dc083a931422cc8a5e33841aff7d5312f2 upstream. The vhost_vsock->guest_cid field is uninitialized when /dev/vhost-vsock is opened until the VHOST_VSOCK_SET_GUEST_CID ioctl is called. kvmalloc(..., GFP_KERNEL | __GFP_RETRY_MAYFAIL) does not zero memory. All other vhost_vsock fields are initialized explicitly so just initialize this field too. Signed-off-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Cc: Daniel Verkamp Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index c9de9c41aa97..5a5e981bd8e4 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -518,6 +518,8 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) goto out; } + vsock->guest_cid = 0; /* no CID assigned yet */ + atomic_set(&vsock->queued_replies, 0); vqs[VSOCK_VQ_TX] = &vsock->vqs[VSOCK_VQ_TX];