lkml.org 
[lkml]   [2006]   [Mar]   [20]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 19 Mar 2006 23:23:27 -0800
FromAndrew Morton <>
SubjectRe: [PATCH] fix potential null pointer deref in quota
Jesper Juhl <jesper.juhl@gmail.com> wrote:
>
> 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;

I'd have thought that check_quotactl_valid() would be the appropriate place
for this check.  Jan, can you please sort out what we need to do here?
-
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: 2006-03-20 07:29    [from the cache]
©2003-2008