Skip to contentSkip to conversation

Lost rtnl_unlock() in vlan_ioctl()

PATCH In review Pavel Emelyanov 3 participants 5 messages Dec 6, 2007 – Dec 7, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Lost rtnl_unlock() in vlan_ioctl()

The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability doesn't release the rtnl lock.

---

net/8021q/vlan.c +1 -1
index 6567213..5b18315 100644
@@ -776,7 +776,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
 	case SET_VLAN_NAME_TYPE_CMD:
 		err = -EPERM;
 		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+			break;
 		if ((args.u.name_type >= 0) &&
 		    (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
 			vlan_name_type = args.u.name_type;
#1 lore raw
Quoted 2 lines · Pavel Emelyanov

The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability doesn't release the rtnl lock.

Thanks Pavel. I somehow recall that we already fixed this one, but can't find the patch :) Dave, please apply.

maintainer
#2 lore raw

From: Patrick McHardy <[email protected]>
Date: Thu, 06 Dec 2007 14:59:24 +0100

Quoted 7 lines
Quoted 2 lines · Pavel Emelyanov

The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability doesn't release the rtnl lock.

Thanks Pavel. I somehow recall that we already fixed this one, but can't find the patch :) Dave, please apply.

I think we even added this bug to -stable, or something like that, didn't we? Yikes...

#3 lore raw
Quoted 4 lines · David Miller

From: Patrick McHardy <[email protected]>
Date: Thu, 06 Dec 2007 14:59:24 +0100

Quoted 1 line

Pavel Emelyanov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability doesn't release the rtnl lock.

Thanks Pavel. I somehow recall that we already fixed this one, but can't find the patch :) Dave, please apply.

I think we even added this bug to -stable, or something like that, didn't we? Yikes...

No, I mixed those two patches up as well. The bug was introduced with the vlan_netlink stuff, the -stable patch fixed an invalid return value, but still properly dropped the lock.

This patch should of course go in -stable anyway.

maintainer
#4 lore raw
In reply to Patrick McHardy

From: Patrick McHardy <[email protected]>
Date: Thu, 06 Dec 2007 14:59:24 +0100

Quoted 7 lines
Quoted 2 lines · Pavel Emelyanov

The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability doesn't release the rtnl lock.

Thanks Pavel. I somehow recall that we already fixed this one, but can't find the patch :) Dave, please apply.

Applied and I'll push to -stable once Linus pulls it in.