public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: bridge: fix ioctl old_deviceless bridge argument
@ 2021-12-22 19:13 Remi Pommarel
  2021-12-22 21:52 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Remi Pommarel @ 2021-12-22 19:13 UTC (permalink / raw)
  To: netdev
  Cc: Roopa Prabhu, Nikolay Aleksandrov, Arnd Bergmann, David S. Miller,
	Jakub Kicinski, bridge, linux-kernel, Remi Pommarel

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

Fixes: 561d8352818f ("bridge: use ndo_siocdevprivate")
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
 net/bridge/br_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index db4ab2c2ce18..891cfcf45644 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];
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-23 18:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-22 19:13 [PATCH net] net: bridge: fix ioctl old_deviceless bridge argument Remi Pommarel
2021-12-22 21:52 ` Arnd Bergmann
2021-12-23 11:00   ` Remi Pommarel
2021-12-23 11:38     ` Arnd Bergmann
2021-12-23 13:33       ` Remi Pommarel
2021-12-23  7:42 ` Nikolay Aleksandrov
2021-12-23 18:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox