lkml.org 
[lkml]   [2004]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH][SELINUX] Fix error handling in selinuxfs
From
Date
Hi,

This patch against 2.6.6 fixes error handling for two out-of-memory
conditions in selinuxfs, avoiding potential deadlock due to returning
without releasing a semaphore. The patch was submitted by Karl
MacMillan of Tresys. Please apply.

security/selinux/selinuxfs.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6/security/selinux/selinuxfs.c
===================================================================
RCS file: /nfshome/pal/CVS/linux-2.6/security/selinux/selinuxfs.c,v
retrieving revision 1.43
diff -u -r1.43 selinuxfs.c
--- linux-2.6/security/selinux/selinuxfs.c 20 Apr 2004 15:40:22 -0000 1.43
+++ linux-2.6/security/selinux/selinuxfs.c 17 May 2004 14:11:03 -0000
@@ -833,8 +833,10 @@
goto out;
}
page = (char*)__get_free_page(GFP_KERNEL);
- if (!page)
- return -ENOMEM;
+ if (!page) {
+ length = -ENOMEM;
+ goto out;
+ }
memset(page, 0, PAGE_SIZE);

if (copy_from_user(page, buf, count))
@@ -889,8 +891,10 @@
goto out;
}
page = (char*)__get_free_page(GFP_KERNEL);
- if (!page)
- return -ENOMEM;
+ if (!page) {
+ length = -ENOMEM;
+ goto out;
+ }

memset(page, 0, PAGE_SIZE);


--
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:2.175 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site