public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	agk@redhat.com, mirq-linux@rere.qmqm.pl,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [patch 17/20] dm: BUG/OOPS fix
Date: Mon, 21 Aug 2006 11:48:07 -0700	[thread overview]
Message-ID: <20060821184807.GS21938@kroah.com> (raw)
In-Reply-To: <20060821184527.GA21938@kroah.com>

[-- Attachment #1: dm-bug-oops-fix.patch --]
[-- Type: text/plain, Size: 2568 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Michal Miroslaw <mirq-linux@rere.qmqm.pl>

Fix BUG I tripped on while testing failover and multipathing.

BUG shows up on error path in multipath_ctr() when parse_priority_group()
fails after returning at least once without error.  The fix is to
initialize m->ti early - just after alloc()ing it.

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
 printing eip:
c027c3d2
*pde = 00000000
Oops: 0000 [#3]
Modules linked in: qla2xxx ext3 jbd mbcache sg ide_cd cdrom floppy
CPU:    0
EIP:    0060:[<c027c3d2>]    Not tainted VLI
EFLAGS: 00010202   (2.6.17.3 #1)
EIP is at dm_put_device+0xf/0x3b
eax: 00000001   ebx: ee4fcac0   ecx: 00000000   edx: ee4fcac0
esi: ee4fc4e0   edi: ee4fc4e0   ebp: 00000000   esp: c5db3e78
ds: 007b   es: 007b   ss: 0068
Process multipathd (pid: 15912, threadinfo=c5db2000 task=ef485a90)
Stack: ec4eda40 c02816bd ee4fc4c0 00000000 f7e89498 f883e0bc c02816f6 f7e89480
       f7e8948c c0281801 ffffffea f7e89480 f883e080 c0281ffe 00000001 00000000
       00000004 dfe9cab8 f7a693c0 f883e080 f883e0c0 ca4b99c0 c027c6ee 01400000
Call Trace:
 <c02816bd> free_pgpaths+0x31/0x45  <c02816f6> free_priority_group+0x25/0x2e
 <c0281801> free_multipath+0x35/0x67  <c0281ffe> multipath_ctr+0x123/0x12d
 <c027c6ee> dm_table_add_target+0x11e/0x18b  <c027e5b4> populate_table+0x8a/0xaf
 <c027e62b> table_load+0x52/0xf9  <c027ec23> ctl_ioctl+0xca/0xfc
 <c027e5d9> table_load+0x0/0xf9  <c0152146> do_ioctl+0x3e/0x43
 <c0152360> vfs_ioctl+0x16c/0x178  <c01523b4> sys_ioctl+0x48/0x60
 <c01029b3> syscall_call+0x7/0xb
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
EIP: [<c027c3d2>] dm_put_device+0xf/0x3b SS:ESP 0068:c5db3e78

Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/dm-mpath.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.17.9.orig/drivers/md/dm-mpath.c
+++ linux-2.6.17.9/drivers/md/dm-mpath.c
@@ -711,6 +711,8 @@ static int multipath_ctr(struct dm_targe
 		return -EINVAL;
 	}
 
+	m->ti = ti;
+
 	r = parse_features(&as, m, ti);
 	if (r)
 		goto bad;
@@ -752,7 +754,6 @@ static int multipath_ctr(struct dm_targe
 	}
 
 	ti->private = m;
-	m->ti = ti;
 
 	return 0;
 

--

  parent reply	other threads:[~2006-08-21 18:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060821183818.155091391@quad.kroah.org>
2006-08-21 18:45 ` [patch 00/20] 2.6.17-stable review Greg KH
2006-08-21 18:45   ` [patch 01/20] Have ext3 reject file handles with bad inode numbers early Greg KH
2006-08-21 18:45   ` [patch 02/20] sky2: phy power problem on 88e805x Greg KH
2006-08-21 18:46   ` [patch 03/20] Kill HASH_HIGHMEM from route cache hash sizing Greg KH
2006-08-21 18:46   ` [patch 04/20] Fix timer race in dst GC code Greg KH
2006-08-21 18:46   ` [patch 05/20] Fix IFLA_ADDRESS handling Greg KH
2006-08-21 18:46   ` [patch 06/20] Fix BeFS slab corruption Greg KH
2006-08-21 18:46   ` [patch 07/20] disable debugging version of write_lock() Greg KH
2006-08-21 18:46   ` [patch 08/20] ipx: header length validation needed Greg KH
2006-08-21 18:46   ` [patch 09/20] tpm: interrupt clear fix Greg KH
2006-08-21 18:46   ` [patch 10/20] : ulog: fix panic on SMP kernels Greg KH
2006-08-21 18:47   ` [patch 11/20] sys_getppid oopses on debug kernel Greg KH
2006-08-21 18:47   ` [patch 12/20] SERIAL: icom: select FW_LOADER Greg KH
2006-08-21 18:47   ` [patch 13/20] PCI: fix ICH6 quirks Greg KH
2006-08-21 18:47   ` [patch 14/20] : ip_tables: fix table locking in ipt_do_table Greg KH
2006-08-21 18:47   ` [patch 15/20] IA64: local DoS with corrupted ELFs Greg KH
2006-08-21 18:47   ` [patch 16/20] Fix ipv4 routing locking bug Greg KH
2006-08-21 18:47   ` Greg KH
2006-08-21 18:48   ` Greg KH [this message]
2006-08-21 18:48   ` [patch 18/20] swsusp: Fix swap_type_of Greg KH
2006-08-21 18:48   ` [patch 19/20] MD: Fix a potential NULL dereference in md/raid1 Greg KH
2006-08-21 18:48   ` [patch 20/20] 1394: fix for recently added firewire patch that breaks things on ppc Greg KH
2006-08-22  9:03     ` Stefan Richter
2006-08-21 19:46   ` [patch 00/20] 2.6.17-stable review Dave Jones
2006-08-21 21:43     ` Greg KH
2006-08-22 13:49       ` John Stoffel
2006-08-22 13:59         ` Kyle Moffett
2006-08-22 14:53           ` John Stoffel
2006-08-22 19:13   ` Herbert Xu's paged unique skb trimming patch? Nix
2006-08-22 19:17     ` Greg KH
2006-08-22 20:41       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060821184807.GS21938@kroah.com \
    --to=gregkh@suse.de \
    --cc=agk@redhat.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox