]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:43 +0000 (09:49 +0100)
commit595f65e84f87fce23b55963f6ce36e71cbd30cdd
treedc0fe5be65f4b73540cf966e2074ba9688c98304
parent479cb61e0b049eb52e17f8b867038884ea1fd64a
net: bridge: fix ioctl old_deviceless bridge argument

BugLink: https://bugs.launchpad.net/bugs/1956305
[ 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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
net/bridge/br_ioctl.c