2006-01-15 11:45:41

by Alexey Dobriyan

[permalink] [raw]
Subject: [STABLE] Fix oops in ufs_fill_super at mount time

From: Evgeniy <[email protected]>

There's a lack of parenthesis in fs/ufs/utils.h, so instead of the 512th
byte of buffer, the usb2 pointer will point to the nth structure of type
ufs_super_block_second.

This can cause a mount-time oops if you're unlucky (especially with
DEBUG_PAGEALLOC, which is how Alexey Dobriyan saw this problem)

Signed-off-by: Evgeniy Dushistov <[email protected]>
Acked-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
---

--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -255,8 +255,8 @@ extern void _ubh_memcpyubh_(struct ufs_s
((struct ufs_super_block_first *)((ubh)->bh[0]->b_data))

#define ubh_get_usb_second(ubh) \
- ((struct ufs_super_block_second *)(ubh)-> \
- bh[UFS_SECTOR_SIZE >> uspi->s_fshift]->b_data + (UFS_SECTOR_SIZE & ~uspi->s_fmask))
+ ((struct ufs_super_block_second *)((ubh)->\
+ bh[UFS_SECTOR_SIZE >> uspi->s_fshift]->b_data + (UFS_SECTOR_SIZE & ~uspi->s_fmask)))

#define ubh_get_usb_third(ubh) \
((struct ufs_super_block_third *)((ubh)-> \


2006-01-15 18:07:13

by Chris Wright

[permalink] [raw]
Subject: Re: [STABLE] Fix oops in ufs_fill_super at mount time

* Alexey Dobriyan ([email protected]) wrote:
> From: Evgeniy <[email protected]>
>
> There's a lack of parenthesis in fs/ufs/utils.h, so instead of the 512th
> byte of buffer, the usb2 pointer will point to the nth structure of type
> ufs_super_block_second.

Thanks Alexey, this one's already queued for the next -stable.
-chris