]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.13/0001-nilfs2-fix-NULL-pointer-dereference-in-nilfs_load_su.patch
linux-ti33x-psp 3.2: update to 3.2.13
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.13 / 0001-nilfs2-fix-NULL-pointer-dereference-in-nilfs_load_su.patch
1 From 4f3587e3e193f8ae9278442bf254d1271c4d010d Mon Sep 17 00:00:00 2001
2 From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
3 Date: Fri, 16 Mar 2012 17:08:39 -0700
4 Subject: [PATCH 01/10] nilfs2: fix NULL pointer dereference in
5  nilfs_load_super_block()
7 commit d7178c79d9b7c5518f9943188091a75fc6ce0675 upstream.
9 According to the report from Slicky Devil, nilfs caused kernel oops at
10 nilfs_load_super_block function during mount after he shrank the
11 partition without resizing the filesystem:
13  BUG: unable to handle kernel NULL pointer dereference at 00000048
14  IP: [<d0d7a08e>] nilfs_load_super_block+0x17e/0x280 [nilfs2]
15  *pde = 00000000
16  Oops: 0000 [#1] PREEMPT SMP
17  ...
18  Call Trace:
19   [<d0d7a87b>] init_nilfs+0x4b/0x2e0 [nilfs2]
20   [<d0d6f707>] nilfs_mount+0x447/0x5b0 [nilfs2]
21   [<c0226636>] mount_fs+0x36/0x180
22   [<c023d961>] vfs_kern_mount+0x51/0xa0
23   [<c023ddae>] do_kern_mount+0x3e/0xe0
24   [<c023f189>] do_mount+0x169/0x700
25   [<c023fa9b>] sys_mount+0x6b/0xa0
26   [<c04abd1f>] sysenter_do_call+0x12/0x28
27  Code: 53 18 8b 43 20 89 4b 18 8b 4b 24 89 53 1c 89 43 24 89 4b 20 8b 43
28  20 c7 43 2c 00 00 00 00 23 75 e8 8b 50 68 89 53 28 8b 54 b3 20 <8b> 72
29  48 8b 7a 4c 8b 55 08 89 b3 84 00 00 00 89 bb 88 00 00 00
30  EIP: [<d0d7a08e>] nilfs_load_super_block+0x17e/0x280 [nilfs2] SS:ESP 0068:ca9bbdcc
31  CR2: 0000000000000048
33 This turned out due to a defect in an error path which runs if the
34 calculated location of the secondary super block was invalid.
36 This patch fixes it and eliminates the reported oops.
38 Reported-by: Slicky Devil <slicky.dvl@gmail.com>
39 Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
40 Tested-by: Slicky Devil <slicky.dvl@gmail.com>
41 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
42 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
43 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
44 ---
45  fs/nilfs2/the_nilfs.c |    1 +
46  1 file changed, 1 insertion(+)
48 diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
49 index d327140..35a8970 100644
50 --- a/fs/nilfs2/the_nilfs.c
51 +++ b/fs/nilfs2/the_nilfs.c
52 @@ -515,6 +515,7 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs,
53                 brelse(sbh[1]);
54                 sbh[1] = NULL;
55                 sbp[1] = NULL;
56 +               valid[1] = 0;
57                 swp = 0;
58         }
59         if (!valid[swp]) {
60 -- 
61 1.7.9.4