diff options
author | Ben Pfaff <blp@nicira.com> | 2010-05-25 15:42:44 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-05-25 15:42:48 -0700 |
commit | 65d9d5f8b8fd548f411c512e946cf2408182a1d4 (patch) | |
tree | 5d8d4c4387bd1df87e5b010bb3dd7033e59c395e | |
parent | 4d9c0a1e256a8c1524ee6e19cd2ae3d026543ba0 (diff) | |
download | openvswitch-65d9d5f8b8fd548f411c512e946cf2408182a1d4.tar.gz |
datapath: Fix ODP_PORT_GROUP_GET implementation.
The final argument to do_get_port_group() is supposed to be a user pointer
to the number of ports, to be updated with put_user(), but it was actually
a kernel pointer, so "ovs-dpctl dump-groups" and anything else that used
this ioctl would always fail with -EFAULT. This commit fixes it.
Bug introduced in commit 44e05eca "datapath: Prepare to support 32-bit
compatibility ioctls" for normal ioctls and for compat ioctls at their
introduction in commit 3fbd517acf"datapath: Add 32-bit compatibility
ioctls."
-rw-r--r-- | datapath/datapath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c index 1d007b04b..fd63fb02b 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1576,7 +1576,7 @@ static int get_port_group(struct datapath *dp, struct odp_port_group __user *upg if (copy_from_user(&pg, upg, sizeof pg)) return -EFAULT; - return do_get_port_group(dp, pg.ports, pg.n_ports, pg.group, &pg.n_ports); + return do_get_port_group(dp, pg.ports, pg.n_ports, pg.group, &upg->n_ports); } static int get_listen_mask(const struct file *f) @@ -1794,7 +1794,7 @@ static int compat_get_port_group(struct datapath *dp, struct compat_odp_port_gro return -EFAULT; return do_get_port_group(dp, compat_ptr(pg.ports), pg.n_ports, - pg.group, &pg.n_ports); + pg.group, &upg->n_ports); } static int compat_get_flow(struct odp_flow *flow, const struct compat_odp_flow __user *compat) |