public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] hfsplus oops on image without extends
@ 2008-05-07 10:42 Eric Sesterhenn
  2008-05-09 13:13 ` Andy Whitcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sesterhenn @ 2008-05-07 10:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, zippel

hi,

the following patch fixes an oops with a corrupted hfs+ image.
see http://bugzilla.kernel.org/show_bug.cgi?id=10548 for details.

Problem is that we call hfs_btree_open() from hfsplus_fill_super() to set
HFSPLUS_SB(sb).[ext_tree|cat_tree]
Both trees are still NULL at this moment. If hfs_btree_open() fails for
any reason it calls iput() on the page, which
gets to hfsplus_releasepage() which tries to access HFSPLUS_SB(sb).*
which is still NULL and oopses while dereferencing it.


Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6/fs/hfsplus/inode.c.orig	2008-05-07 14:37:31.000000000 +0200
+++ linux-2.6/fs/hfsplus/inode.c	2008-05-07 14:38:05.000000000 +0200
@@ -65,6 +65,8 @@ static int hfsplus_releasepage(struct pa
 		BUG();
 		return 0;
 	}
+	it (!tree)
+		return 0;
 	if (tree->node_size >= PAGE_CACHE_SIZE) {
 		nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT);
 		spin_lock(&tree->hash_lock);

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

* Re: [Patch] hfsplus oops on image without extends
  2008-05-07 10:42 [Patch] hfsplus oops on image without extends Eric Sesterhenn
@ 2008-05-09 13:13 ` Andy Whitcroft
  2008-05-09 14:26   ` Eric Sesterhenn
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Whitcroft @ 2008-05-09 13:13 UTC (permalink / raw)
  To: Eric Sesterhenn; +Cc: linux-kernel, akpm, zippel

On Wed, May 07, 2008 at 12:42:44PM +0200, Eric Sesterhenn wrote:
> hi,
> 
> the following patch fixes an oops with a corrupted hfs+ image.
> see http://bugzilla.kernel.org/show_bug.cgi?id=10548 for details.
> 
> Problem is that we call hfs_btree_open() from hfsplus_fill_super() to set
> HFSPLUS_SB(sb).[ext_tree|cat_tree]
> Both trees are still NULL at this moment. If hfs_btree_open() fails for
> any reason it calls iput() on the page, which
> gets to hfsplus_releasepage() which tries to access HFSPLUS_SB(sb).*
> which is still NULL and oopses while dereferencing it.
> 
> 
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
> 
> --- linux-2.6/fs/hfsplus/inode.c.orig	2008-05-07 14:37:31.000000000 +0200
> +++ linux-2.6/fs/hfsplus/inode.c	2008-05-07 14:38:05.000000000 +0200
> @@ -65,6 +65,8 @@ static int hfsplus_releasepage(struct pa
>  		BUG();
>  		return 0;
>  	}
> +	it (!tree)
> +		return 0;

Erm, I presume this is meant to be 'if', checkpatch whined about the
space as it thought it was a function.  I guess this hasn't been compile
tested?

>  	if (tree->node_size >= PAGE_CACHE_SIZE) {
>  		nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT);
>  		spin_lock(&tree->hash_lock);

-apw

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

* Re: [Patch] hfsplus oops on image without extends
  2008-05-09 13:13 ` Andy Whitcroft
@ 2008-05-09 14:26   ` Eric Sesterhenn
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sesterhenn @ 2008-05-09 14:26 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: linux-kernel, akpm, zippel

* Andy Whitcroft (apw@shadowen.org) wrote:
> On Wed, May 07, 2008 at 12:42:44PM +0200, Eric Sesterhenn wrote:
> > hi,
> > 
> > the following patch fixes an oops with a corrupted hfs+ image.
> > see http://bugzilla.kernel.org/show_bug.cgi?id=10548 for details.
> > 
> > Problem is that we call hfs_btree_open() from hfsplus_fill_super() to set
> > HFSPLUS_SB(sb).[ext_tree|cat_tree]
> > Both trees are still NULL at this moment. If hfs_btree_open() fails for
> > any reason it calls iput() on the page, which
> > gets to hfsplus_releasepage() which tries to access HFSPLUS_SB(sb).*
> > which is still NULL and oopses while dereferencing it.
> 
> Erm, I presume this is meant to be 'if', checkpatch whined about the
> space as it thought it was a function.  I guess this hasn't been compile
> tested?

sorry, i messed this up, didnt have the original patch anymore and
quickly recreated it. Andrew already put a fix in -mm

Greetings, Eric

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

end of thread, other threads:[~2008-05-09 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 10:42 [Patch] hfsplus oops on image without extends Eric Sesterhenn
2008-05-09 13:13 ` Andy Whitcroft
2008-05-09 14:26   ` Eric Sesterhenn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox