From patchwork Sun Dec 20 12:02:57 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: 68971 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 nBKC5oTQ001856 for ; Sun, 20 Dec 2009 12:05:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753991AbZLTMFs (ORCPT ); Sun, 20 Dec 2009 07:05:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753669AbZLTMFr (ORCPT ); Sun, 20 Dec 2009 07:05:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753822AbZLTMFq (ORCPT ); Sun, 20 Dec 2009 07:05:46 -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 nBKC5fEl029788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 Dec 2009 07:05:41 -0500 Received: from redhat.com (vpn-6-183.tlv.redhat.com [10.35.6.183]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nBKC5d5F021006; Sun, 20 Dec 2009 07:05:40 -0500 Date: Sun, 20 Dec 2009 14:02:57 +0200 From: "Michael S. Tsirkin" To: David Stevens Cc: rusty@rustcorp.com.au, kvm@vger.kernel.org Subject: Re: [PATCH] fix vhost ioctl handling for 32-bit Message-ID: <20091220120256.GA26263@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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)