FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 11-09-2009, 07:41 PM
John Johansen
 
Default UBUNTU: SAUCE: AppArmor: Fix refcounting bug causing leak of creds

BugLink: http://bugs.launchpad.net/bugs/479115

AppArmor when doing ptrace check for domain changes, fails to drop
the ref count on the task creds when it is unconfined.

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
ubuntu/apparmor/domain.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ubuntu/apparmor/domain.c b/ubuntu/apparmor/domain.c
index 0594ea2..95cf5f5 100644
--- a/ubuntu/apparmor/domain.c
+++ b/ubuntu/apparmor/domain.c
@@ -65,9 +65,10 @@ static int aa_may_change_ptraced_domain(struct task_struct *task,
rcu_read_unlock();

if (!tracerp)
- return error;
+ goto out;

error = aa_may_ptrace(tracer, tracerp, to_profile, PTRACE_MODE_ATTACH);
+out:
put_cred(cred);

return error;
--
1.6.3.3


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 11-10-2009, 05:29 PM
John Johansen
 
Default UBUNTU: SAUCE: AppArmor: Fix refcounting bug causing leak of creds

BugLink: http://bugs.launchpad.net/bugs/479115

SRU Justification: Failure to put the cred causes a memory leak that is
larger than the cred struct, as it leaks everything it references. This
happens for every unconfined processes that does an exec, change_hat or
change_profile and passes through this function.

AppArmor when doing ptrace check for domain changes, fails to drop
the ref count on the task creds when it is unconfined.

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
ubuntu/apparmor/domain.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ubuntu/apparmor/domain.c b/ubuntu/apparmor/domain.c
index 128e527..fe89ddc 100644
--- a/ubuntu/apparmor/domain.c
+++ b/ubuntu/apparmor/domain.c
@@ -65,9 +65,10 @@ static int aa_may_change_ptraced_domain(struct task_struct *task,
rcu_read_unlock();

if (!tracerp)
- return error;
+ goto out;

error = aa_may_ptrace(tracer, tracerp, to_profile, PTRACE_MODE_ATTACH);
+out:
put_cred(cred);

return error;
--
1.6.3.3


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 09:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org