diff options
author | Remi Pommarel <repk@triplefau.lt> | 2021-12-23 18:31:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-29 14:28:46 +0300 |
commit | b8871c6734d8e17b0ea2c58d9ebe9f201c60a8eb (patch) | |
tree | ac680d3a256fab5d3aac9a5fbd4c496f1209ffb5 /net/bridge | |
parent | 1c66ea39c6c44821b2a72d9b27bba7d3a839a984 (diff) | |
download | linux-b8871c6734d8e17b0ea2c58d9ebe9f201c60a8eb.tar.xz |
net: bridge: fix ioctl old_deviceless bridge argument
[ Upstream commit d95a56207c078e2019cf6659d890ec1e987e8420 ]
Commit 561d8352818f ("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 cbd7ad29a507 ("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: 561d8352818f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 49c268871fc1..9922497e59f8 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c @@ -337,7 +337,7 @@ static int old_deviceless(struct net *net, void __user *uarg) args[2] = get_bridge_ifindices(net, indices, args[2]); - ret = copy_to_user(uarg, indices, + ret = copy_to_user((void __user *)args[1], indices, array_size(args[2], sizeof(int))) ? -EFAULT : args[2]; |