public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Lukáš Czerner" <lczerner@redhat.com>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	linux-ext4 <linux-ext4@vger.kernel.org>,
	"'Dan Carpenter'" <dan.carpenter@oracle.com>,
	Ashish Sangwan <a.sangwan@samsung.com>
Subject: Re: [PATCH] ext4: fix potential null pointer dereference in ext4_free_inode
Date: Tue, 8 Jul 2014 13:00:09 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1407081259150.2180@localhost.localdomain> (raw)
In-Reply-To: <002901cf9a6f$401a0c50$c04e24f0$@samsung.com>

On Tue, 8 Jul 2014, Namjae Jeon wrote:

> Date: Tue, 08 Jul 2014 14:41:22 +0900
> From: Namjae Jeon <namjae.jeon@samsung.com>
> To: Theodore Ts'o <tytso@mit.edu>
> Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
>     'Dan Carpenter' <dan.carpenter@oracle.com>,
>     Ashish Sangwan <a.sangwan@samsung.com>
> Subject: [PATCH] ext4: fix potential null pointer dereference in
>     ext4_free_inode
> 
> Fix potential null pointer dereferencing problem caused by e43bb4e612
> ("ext4: decrement free clusters/inodes counters when block group declared bad")
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>

Looks good.

Reviewed-by: Lukas Czerner <lczerner@redhat.com>

> ---
>  fs/ext4/ialloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
> index a87455d..6bfe7eb 100644
> --- a/fs/ext4/ialloc.c
> +++ b/fs/ext4/ialloc.c
> @@ -338,7 +338,7 @@ out:
>  			fatal = err;
>  	} else {
>  		ext4_error(sb, "bit already cleared for inode %lu", ino);
> -		if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {
> +		if (gdp && !EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {
>  			int count;
>  			count = ext4_free_inodes_count(sb, gdp);
>  			percpu_counter_sub(&sbi->s_freeinodes_counter,
> 

      reply	other threads:[~2014-07-08 11:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08  5:41 [PATCH] ext4: fix potential null pointer dereference in ext4_free_inode Namjae Jeon
2014-07-08 11:00 ` Lukáš Czerner [this message]

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=alpine.LFD.2.00.1407081259150.2180@localhost.localdomain \
    --to=lczerner@redhat.com \
    --cc=a.sangwan@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox