From: John Fastabend <hidden> Date: 2012-08-14 22:50:23
Add lock to prevent a race with a file closing and also remove
useless and ugly sscanf code. The extra code was never needed
and the case it supposedly protected against is in fact handled
correctly by sock_from_file as pointed out by Al Viro.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/netprio_cgroup.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
@@ -277,12 +277,6 @@ out_free_devname:voidnet_prio_attach(structcgroup*cgrp,structcgroup_taskset*tset){structtask_struct*p;-char*tmp=kzalloc(sizeof(char)*PATH_MAX,GFP_KERNEL);--if(!tmp){-pr_warn("Unable to attach cgrp due to alloc failure!\n");-return;-}cgroup_taskset_for_each(p,cgrp,tset){unsignedintfd;
From: John Fastabend <hidden> Date: 2012-08-14 22:50:30
A socket fd passed in a SCM_RIGHTS datagram was not getting
updated with the new tasks cgrp prioidx. This leaves IO on
the socket tagged with the old tasks priority.
To fix this add a check in the scm recvmsg path to update the
sock cgrp prioidx with the new tasks value.
Thanks to Al Viro for catching this.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/scm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
From: John Fastabend <hidden> Date: 2012-08-14 22:50:35
A race exists where creating cgroups and also updating the priomap
may result in losing a priomap update. This is because priomap
writers are not protected by rtnl_lock.
Move priority writer into rtnl_lock()/rtnl_unlock().
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/netprio_cgroup.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
From: Neil Horman <nhorman@tuxdriver.com> Date: 2012-08-15 10:52:30
On Tue, Aug 14, 2012 at 03:34:24PM -0700, John Fastabend wrote:
quoted hunk
Add lock to prevent a race with a file closing and also remove
useless and ugly sscanf code. The extra code was never needed
and the case it supposedly protected against is in fact handled
correctly by sock_from_file as pointed out by Al Viro.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/netprio_cgroup.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
@@ -277,12 +277,6 @@ out_free_devname:voidnet_prio_attach(structcgroup*cgrp,structcgroup_taskset*tset){structtask_struct*p;-char*tmp=kzalloc(sizeof(char)*PATH_MAX,GFP_KERNEL);--if(!tmp){-pr_warn("Unable to attach cgrp due to alloc failure!\n");-return;-}cgroup_taskset_for_each(p,cgrp,tset){unsignedintfd;
From: Neil Horman <nhorman@tuxdriver.com> Date: 2012-08-15 10:53:47
On Tue, Aug 14, 2012 at 03:34:30PM -0700, John Fastabend wrote:
quoted hunk
A socket fd passed in a SCM_RIGHTS datagram was not getting
updated with the new tasks cgrp prioidx. This leaves IO on
the socket tagged with the old tasks priority.
To fix this add a check in the scm recvmsg path to update the
sock cgrp prioidx with the new tasks value.
Thanks to Al Viro for catching this.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/scm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
From: Neil Horman <nhorman@tuxdriver.com> Date: 2012-08-15 10:56:25
On Tue, Aug 14, 2012 at 03:34:35PM -0700, John Fastabend wrote:
quoted hunk
A race exists where creating cgroups and also updating the priomap
may result in losing a priomap update. This is because priomap
writers are not protected by rtnl_lock.
Move priority writer into rtnl_lock()/rtnl_unlock().
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/netprio_cgroup.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
From: Al Viro <viro@ZenIV.linux.org.uk> Date: 2012-08-15 20:03:36
On Wed, Aug 15, 2012 at 06:52:06AM -0400, Neil Horman wrote:
On Tue, Aug 14, 2012 at 03:34:24PM -0700, John Fastabend wrote:
quoted
Add lock to prevent a race with a file closing and also remove
useless and ugly sscanf code. The extra code was never needed
and the case it supposedly protected against is in fact handled
correctly by sock_from_file as pointed out by Al Viro.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
---
net/core/netprio_cgroup.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
@@ -277,12 +277,6 @@ out_free_devname:voidnet_prio_attach(structcgroup*cgrp,structcgroup_taskset*tset){structtask_struct*p;-char*tmp=kzalloc(sizeof(char)*PATH_MAX,GFP_KERNEL);--if(!tmp){-pr_warn("Unable to attach cgrp due to alloc failure!\n");-return;-}cgroup_taskset_for_each(p,cgrp,tset){unsignedintfd;
From: David Miller <davem@davemloft.net> Date: 2012-08-16 22:11:49
From: John Fastabend <redacted>
Date: Tue, 14 Aug 2012 15:34:24 -0700
Add lock to prevent a race with a file closing and also remove
useless and ugly sscanf code. The extra code was never needed
and the case it supposedly protected against is in fact handled
correctly by sock_from_file as pointed out by Al Viro.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
From: David Miller <davem@davemloft.net> Date: 2012-08-16 22:11:55
From: John Fastabend <redacted>
Date: Tue, 14 Aug 2012 15:34:30 -0700
A socket fd passed in a SCM_RIGHTS datagram was not getting
updated with the new tasks cgrp prioidx. This leaves IO on
the socket tagged with the old tasks priority.
To fix this add a check in the scm recvmsg path to update the
sock cgrp prioidx with the new tasks value.
Thanks to Al Viro for catching this.
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>
From: David Miller <davem@davemloft.net> Date: 2012-08-16 22:12:01
From: John Fastabend <redacted>
Date: Tue, 14 Aug 2012 15:34:35 -0700
A race exists where creating cgroups and also updating the priomap
may result in losing a priomap update. This is because priomap
writers are not protected by rtnl_lock.
Move priority writer into rtnl_lock()/rtnl_unlock().
CC: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: John Fastabend <redacted>