From patchwork Tue Dec 22 11:39:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 69265 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBMBi72A000426 for ; Tue, 22 Dec 2009 11:44:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbZLVLnG (ORCPT ); Tue, 22 Dec 2009 06:43:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752952AbZLVLnD (ORCPT ); Tue, 22 Dec 2009 06:43:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56711 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753024AbZLVLmi (ORCPT ); Tue, 22 Dec 2009 06:42:38 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBMBgJC6014427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Dec 2009 06:42:19 -0500 Received: from redhat.com (vpn-6-200.tlv.redhat.com [10.35.6.200]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nBMBgHw5005109; Tue, 22 Dec 2009 06:42:17 -0500 Date: Tue, 22 Dec 2009 13:39:33 +0200 From: "Michael S. Tsirkin" To: David Stevens Cc: rusty@rustcorp.com.au, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH] vhost: fix high 32 bit in FEATURES ioctls Message-ID: <20091222113933.GA16103@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 22d5fef..d6db10c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -563,7 +563,7 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, { struct vhost_net *n = f->private_data; void __user *argp = (void __user *)arg; - u32 __user *featurep = argp; + u64 __user *featurep = argp; struct vhost_vring_file backend; u64 features; int r; @@ -575,10 +575,9 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, return vhost_net_set_backend(n, backend.index, backend.fd); case VHOST_GET_FEATURES: features = VHOST_FEATURES; - return put_user(features, featurep); + return copy_to_user(featurep, &features, sizeof features); case VHOST_SET_FEATURES: - r = get_user(features, featurep); - /* No features for now */ + r = copy_from_user(&features, featurep, sizeof features); if (r < 0) return r; if (features & ~VHOST_FEATURES)