OpenVZ Forum


Home » Mailing lists » Devel » [PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl()
[PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl() [message #24575] Thu, 06 December 2007 13:52 Go to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
The SET_VLAN_NAME_TYPE_CMD command w/o CAP_NET_ADMIN capability
doesn't release the rtnl lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 6567213..5b18315 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -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;
Re: [PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl() [message #24580 is a reply to message #24575] Thu, 06 December 2007 13:59 Go to previous messageGo to next message
Patrick McHardy is currently offline  Patrick McHardy
Messages: 107
Registered: March 2006
Senior Member
Pavel Emelyanov wrote:
> 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.
Re: [PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl() [message #24581 is a reply to message #24580] Thu, 06 December 2007 14:01 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Patrick McHardy <kaber@trash.net>
Date: Thu, 06 Dec 2007 14:59:24 +0100

> Pavel Emelyanov wrote:
> > 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...
Re: [PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl() [message #24584 is a reply to message #24581] Thu, 06 December 2007 14:10 Go to previous messageGo to next message
Patrick McHardy is currently offline  Patrick McHardy
Messages: 107
Registered: March 2006
Senior Member
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Thu, 06 Dec 2007 14:59:24 +0100
> 
>> Pavel Emelyanov wrote:
>>> 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.
Re: [PATCH][VLAN] Lost rtnl_unlock() in vlan_ioctl() [message #24639 is a reply to message #24580] Fri, 07 December 2007 06:52 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Patrick McHardy <kaber@trash.net>
Date: Thu, 06 Dec 2007 14:59:24 +0100

> Pavel Emelyanov wrote:
> > 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.
Previous Topic: [PATCH] pid: sys_wait... fixes
Next Topic: [PATCH 2.6.25] multiple namespaces in the all dst_ifdown routines
Goto Forum:
  


Current Time: Tue Jul 16 18:31:51 GMT 2024

Total time taken to generate the page: 0.02960 seconds