]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: fix ioctl old_deviceless bridge argument
authorRemi Pommarel <repk@triplefau.lt>
Thu, 23 Dec 2021 15:31:38 +0000 (16:31 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 23 Dec 2021 17:53:50 +0000 (09:53 -0800)
commitf82ddfc568c51828766d8cd5a7fb379e4a948b9a
tree82e9c1ec718f565567328f5da6586fea6f0a9e65
parent018f96c67f9dfbb81d0d27be3155a5ae21256984
net: bridge: fix ioctl old_deviceless bridge argument

Commit a0724901d28b ("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 9da0e43c67b0 ("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: a0724901d28b ("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>
net/bridge/br_ioctl.c