[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100503235019.GA16384@us.ibm.com>
Date: Mon, 3 May 2010 18:50:19 -0500
From: "Serge E. Hallyn" <serue@...ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
Ashwin Ganti <ashwin.ganti@...il.com>,
David Howells <dhowells@...hat.com>, Greg KH <greg@...ah.com>,
rsc@...ch.com, ericvh@...il.com,
linux-security-module@...r.kernel.org,
Ron Minnich <rminnich@...il.com>, jt.beard@...il.com,
Andrew Morgan <morgan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Paris <eparis@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Randy Dunlap <rdunlap@...otime.net>,
Michael Kerrisk <mtk.manpages@...il.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Kyle Moffett <kyle@...fetthome.net>,
Steve Grubb <sgrubb@...hat.com>
Subject: Re: [PATCH 3/3] RFC: p9auth: add p9auth fs
Thanks for the comments, Oleg. I will fold this patch into the
main patch, but I'll spare everyone a full repost right now.
thanks,
-serge
From: Serge E. Hallyn <serue@...ibm.com>
Subject: [PATCH 1/1] p9auth: address feedback
Address two comments by Oleg:
Return -ERESTARTNOINTR rather than -EINTR if we are interrupted
while waiting on cap_mutex. And check size of input buffer for
something sane. A user with hundreds of auxilliary groups could
end up with a > PAGE_SIZE message, so maybe this is a bit too
stringent, but I'm not sure how realistic that is.
Signed-off-by: Serge E. Hallyn <serue@...ibm.com>
---
kernel/p9auth.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/p9auth.c b/kernel/p9auth.c
index a174373..5f89b4d 100644
--- a/kernel/p9auth.c
+++ b/kernel/p9auth.c
@@ -354,7 +354,10 @@ static ssize_t p9auth_grant_write(struct file *file, const char __user *buffer,
char *user_buf;
if (mutex_lock_interruptible(&cap_mutex))
- return -EINTR;
+ return -ERESTARTNOINTR;
+
+ if (count > PAGE_SIZE)
+ return -E2BIG;
user_buf = kzalloc(count+1, GFP_KERNEL);
if (!user_buf)
@@ -387,7 +390,10 @@ static ssize_t p9auth_use_write(struct file *file, const char __user *buffer,
char *user_buf;
if (mutex_lock_interruptible(&cap_mutex))
- return -EINTR;
+ return -ERESTARTNOINTR;
+
+ if (count > PAGE_SIZE)
+ return -E2BIG;
user_buf = kzalloc(count+1, GFP_KERNEL);
if (!user_buf)
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists