Skip to content

Commit 3ea7924

Browse files
mstsirkindavem330
authored andcommitted
macvtap: fix TUNSETSNDBUF values > 64k
Upon TUNSETSNDBUF, macvtap reads the requested sndbuf size into a local variable u. commit 39ec7de ("macvtap: fix uninitialized access on TUNSETIFF") changed its type to u16 (which is the right thing to do for all other macvtap ioctls), breaking all values > 64k. The value of TUNSETSNDBUF is actually a signed 32 bit integer, so the right thing to do is to read it into an int. Cc: David S. Miller <[email protected]> Fixes: 39ec7de ("macvtap: fix uninitialized access on TUNSETIFF") Reported-by: Mark A. Peloquin Bisected-by: Matthew Rosato <[email protected]> Reported-by: Christian Borntraeger <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Tested-by: Matthew Rosato <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 83cf9a2 commit 3ea7924

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/macvtap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,10 +1111,10 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
11111111
return 0;
11121112

11131113
case TUNSETSNDBUF:
1114-
if (get_user(u, up))
1114+
if (get_user(s, sp))
11151115
return -EFAULT;
11161116

1117-
q->sk.sk_sndbuf = u;
1117+
q->sk.sk_sndbuf = s;
11181118
return 0;
11191119

11201120
case TUNGETVNETHDRSZ:

0 commit comments

Comments
 (0)