]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.17.11/dm-bug-oops-fix.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.17.11 / dm-bug-oops-fix.patch
1 From stable-bounces@linux.kernel.org Sun Aug 13 23:24:58 2006
2 Message-Id: <200608140624.k7E6OKjC006995@shell0.pdx.osdl.net>
3 To: greg@kroah.com
4 From: akpm@osdl.org
5 Date: Sun, 13 Aug 2006 23:24:20 -0700
6 Cc: akpm@osdl.org, torvalds@osdl.org, stable@kernel.org, agk@redhat.com, mirq-linux@rere.qmqm.pl
7 Subject: dm: BUG/OOPS fix
8
9 From: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
10
11 Fix BUG I tripped on while testing failover and multipathing.
12
13 BUG shows up on error path in multipath_ctr() when parse_priority_group()
14 fails after returning at least once without error. The fix is to
15 initialize m->ti early - just after alloc()ing it.
16
17 BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
18 printing eip:
19 c027c3d2
20 *pde = 00000000
21 Oops: 0000 [#3]
22 Modules linked in: qla2xxx ext3 jbd mbcache sg ide_cd cdrom floppy
23 CPU: 0
24 EIP: 0060:[<c027c3d2>] Not tainted VLI
25 EFLAGS: 00010202 (2.6.17.3 #1)
26 EIP is at dm_put_device+0xf/0x3b
27 eax: 00000001 ebx: ee4fcac0 ecx: 00000000 edx: ee4fcac0
28 esi: ee4fc4e0 edi: ee4fc4e0 ebp: 00000000 esp: c5db3e78
29 ds: 007b es: 007b ss: 0068
30 Process multipathd (pid: 15912, threadinfo=c5db2000 task=ef485a90)
31 Stack: ec4eda40 c02816bd ee4fc4c0 00000000 f7e89498 f883e0bc c02816f6 f7e89480
32 f7e8948c c0281801 ffffffea f7e89480 f883e080 c0281ffe 00000001 00000000
33 00000004 dfe9cab8 f7a693c0 f883e080 f883e0c0 ca4b99c0 c027c6ee 01400000
34 Call Trace:
35 <c02816bd> free_pgpaths+0x31/0x45 <c02816f6> free_priority_group+0x25/0x2e
36 <c0281801> free_multipath+0x35/0x67 <c0281ffe> multipath_ctr+0x123/0x12d
37 <c027c6ee> dm_table_add_target+0x11e/0x18b <c027e5b4> populate_table+0x8a/0xaf
38 <c027e62b> table_load+0x52/0xf9 <c027ec23> ctl_ioctl+0xca/0xfc
39 <c027e5d9> table_load+0x0/0xf9 <c0152146> do_ioctl+0x3e/0x43
40 <c0152360> vfs_ioctl+0x16c/0x178 <c01523b4> sys_ioctl+0x48/0x60
41 <c01029b3> syscall_call+0x7/0xb
42 Code: 97 f0 00 00 00 89 c1 83 c9 01 80 e2 01 0f 44 c1 88 43 14 8b 04 24 59 5b 5e 5f 5d c3 53 89 c1 89 d3 ff 4a 08 0f 94 c0 84 c0 74 2a <8b> 01 8b 10 89 d8 e8 f6 fb ff ff 8b 03 8b 53 04 89 50 04 89 02
43 EIP: [<c027c3d2>] dm_put_device+0xf/0x3b SS:ESP 0068:c5db3e78
44
45 Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
46 Acked-by: Alasdair G Kergon <agk@redhat.com>
47 Signed-off-by: Andrew Morton <akpm@osdl.org>
48 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
49
50 ---
51 drivers/md/dm-mpath.c | 3 ++-
52 1 file changed, 2 insertions(+), 1 deletion(-)
53
54 --- linux-2.6.17.9.orig/drivers/md/dm-mpath.c
55 +++ linux-2.6.17.9/drivers/md/dm-mpath.c
56 @@ -711,6 +711,8 @@ static int multipath_ctr(struct dm_targe
57 return -EINVAL;
58 }
59
60 + m->ti = ti;
61 +
62 r = parse_features(&as, m, ti);
63 if (r)
64 goto bad;
65 @@ -752,7 +754,6 @@ static int multipath_ctr(struct dm_targe
66 }
67
68 ti->private = m;
69 - m->ti = ti;
70
71 return 0;
72