Skip to content

Commit d95a562

Browse files
repkkuba-moo
authored andcommitted
net: bridge: fix ioctl old_deviceless bridge argument
Commit 561d835 ("bridge: use ndo_siocdevprivate") changed the source and destination arguments of copy_{to,from}_user in bridge's old_deviceless() from args[1] to uarg breaking SIOC{G,S}IFBR ioctls. Commit cbd7ad2 ("net: bridge: fix ioctl old_deviceless bridge argument") fixed only BRCTL_{ADD,DEL}_BRIDGES commands leaving BRCTL_GET_BRIDGES one untouched. The fixes BRCTL_GET_BRIDGES as well and has been tested with busybox's brctl. Example of broken brctl: $ brctl show bridge name bridge id STP enabled interfaces brctl: can't get bridge name for index 0: No such device or address Example of fixed brctl: $ brctl show bridge name bridge id STP enabled interfaces br0 8000.000000000000 no Fixes: 561d835 ("bridge: use ndo_siocdevprivate") Signed-off-by: Remi Pommarel <repk@triplefau.lt> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com> Link: https://lore.kernel.org/all/20211223153139.7661-2-repk@triplefau.lt/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent eccffcf commit d95a562

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/bridge/br_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int old_deviceless(struct net *net, void __user *uarg)
337337

338338
args[2] = get_bridge_ifindices(net, indices, args[2]);
339339

340-
ret = copy_to_user(uarg, indices,
340+
ret = copy_to_user((void __user *)args[1], indices,
341341
array_size(args[2], sizeof(int)))
342342
? -EFAULT : args[2];
343343

0 commit comments

Comments
 (0)