From 7fd0fae6710c15af3fbbb85813565cdb106c628b Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Sat, 14 Jan 2006 23:34:33 -0800 Subject: [PATCH] Add ufs mount oops fix, fwd from akpm --- ...oops-in-ufs_fill_super-at-mount-time.patch | 33 +++++++++++++++++++ queue/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 queue/fix-oops-in-ufs_fill_super-at-mount-time.patch diff --git a/queue/fix-oops-in-ufs_fill_super-at-mount-time.patch b/queue/fix-oops-in-ufs_fill_super-at-mount-time.patch new file mode 100644 index 00000000000..76216fdf832 --- /dev/null +++ b/queue/fix-oops-in-ufs_fill_super-at-mount-time.patch @@ -0,0 +1,33 @@ +From nobody Mon Sep 17 00:00:00 2001 +Subject: [PATCH] Fix oops in ufs_fill_super at mount time +From: Evgeniy +Date: 1137165135 +0300 + +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 +Acked-by: Alexey Dobriyan +Signed-off-by: Linus Torvalds +Signed-off-by: Chris Wright +--- + fs/ufs/util.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- linux-2.6.15.1.orig/fs/ufs/util.h ++++ linux-2.6.15.1/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)-> \ diff --git a/queue/series b/queue/series index 0ab8bfa26ef..0366f1c10fd 100644 --- a/queue/series +++ b/queue/series @@ -2,3 +2,4 @@ usb-audio-dont-use-empty-packets-at-start-of-playback.patch kill-blk_attempt_remerge.patch input-hid-fix-an-oops-in-pid-initialization-code.patch fix-double-decrement-of-mqueue_mnt-mnt_count-in-sys_mq_open.patch +fix-oops-in-ufs_fill_super-at-mount-time.patch -- 2.47.3