All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix potential null pointer deref in quota
@ 2006-03-18 22:08 Jesper Juhl
  2006-03-20  7:23 ` Andrew Morton
  2006-03-20  9:46 ` Jan Kara
  0 siblings, 2 replies; 5+ messages in thread
From: Jesper Juhl @ 2006-03-18 22:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jan Kara, Jesper Juhl

The coverity checker noticed that we may pass a NULL super_block to
do_quotactl() that dereferences it.
Dereferencing NULL pointers is bad medicine, better check and fail 
gracefully.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 fs/quota.c |    3 +++
 1 files changed, 3 insertions(+)

--- linux-2.6.16-rc6-orig/fs/quota.c	2006-03-12 14:19:02.000000000 +0100
+++ linux-2.6.16-rc6/fs/quota.c	2006-03-18 23:03:32.000000000 +0100
@@ -231,6 +231,9 @@ static int do_quotactl(struct super_bloc
 {
 	int ret;
 
+	if (!sb)
+		return -ENODEV;
+
 	switch (cmd) {
 		case Q_QUOTAON: {
 			char *pathname;



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-26 12:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-18 22:08 [PATCH] fix potential null pointer deref in quota Jesper Juhl
2006-03-20  7:23 ` Andrew Morton
2006-03-20  8:01   ` Jesper Juhl
2006-03-20  9:46 ` Jan Kara
2006-03-26 12:44   ` Jesper Juhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.