All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, jack@suse.cz, jesper.juhl@gmail.com
Subject: Re: [PATCH] fix potential null pointer deref in quota
Date: Sun, 19 Mar 2006 23:23:27 -0800	[thread overview]
Message-ID: <20060319232327.005c91e4.akpm@osdl.org> (raw)
In-Reply-To: <200603182308.05050.jesper.juhl@gmail.com>

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?

  reply	other threads:[~2006-03-20  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18 22:08 [PATCH] fix potential null pointer deref in quota Jesper Juhl
2006-03-20  7:23 ` Andrew Morton [this message]
2006-03-20  8:01   ` Jesper Juhl
2006-03-20  9:46 ` Jan Kara
2006-03-26 12:44   ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060319232327.005c91e4.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jack@suse.cz \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.