mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Namhyung Kim <namhyung@gmail.com>, NeilBrown <neilb@suse.de>
Subject: [75/85] md: check ->hot_remove_disk when removing disk
Date: Wed, 15 Jun 2011 17:29:11 -0700	[thread overview]
Message-ID: <20110616002911.374643551@clark.kroah.org> (raw)
In-Reply-To: <20110616002917.GA3627@kroah.com>

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

------------------

From: Namhyung Kim <namhyung@gmail.com>

commit 01393f3d5836b7d62e925e6f4658a7eb22b83a11 upstream.

Check pers->hot_remove_disk instead of pers->hot_add_disk in slot_store()
during disk removal. The linear personality only has ->hot_add_disk and
no ->hot_remove_disk, so that removing disk in the array resulted to
following kernel bug:

$ sudo mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/loop[0-3]
$ echo none | sudo tee /sys/block/md0/md/dev-loop2/slot
 BUG: unable to handle kernel NULL pointer dereference at           (null)
 IP: [<          (null)>]           (null)
 PGD c9f5d067 PUD 8575a067 PMD 0
 Oops: 0010 [#1] SMP
 CPU 2
 Modules linked in: linear loop bridge stp llc kvm_intel kvm asus_atk0110 sr_mod cdrom sg

 Pid: 10450, comm: tee Not tainted 3.0.0-rc1-leonard+ #173 System manufacturer System Product Name/P5G41TD-M PRO
 RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
 RSP: 0018:ffff880085757df0  EFLAGS: 00010282
 RAX: ffffffffa00168e0 RBX: ffff8800d1431800 RCX: 000000000000006e
 RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff88008543c000
 RBP: ffff880085757e48 R08: 0000000000000002 R09: 000000000000000a
 R10: 0000000000000000 R11: ffff88008543c2e0 R12: 00000000ffffffff
 R13: ffff8800b4641000 R14: 0000000000000005 R15: 0000000000000000
 FS:  00007fe8c9e05700(0000) GS:ffff88011fa00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 00000000b4502000 CR4: 00000000000406e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process tee (pid: 10450, threadinfo ffff880085756000, task ffff8800c9f08000)
 Stack:
  ffffffff8138496a ffff8800b4641000 ffff88008543c268 0000000000000000
  ffff8800b4641000 ffff88008543c000 ffff8800d1431868 ffffffff81a78a90
  ffff8800b4641000 ffff88008543c000 ffff8800d1431800 ffff880085757e98
 Call Trace:
  [<ffffffff8138496a>] ? slot_store+0xaa/0x265
  [<ffffffff81384bae>] rdev_attr_store+0x89/0xa8
  [<ffffffff8115a96a>] sysfs_write_file+0x108/0x144
  [<ffffffff81106b87>] vfs_write+0xb1/0x10d
  [<ffffffff8106e6c0>] ? trace_hardirqs_on_caller+0x111/0x135
  [<ffffffff81106cac>] sys_write+0x4d/0x77
  [<ffffffff814fe702>] system_call_fastpath+0x16/0x1b
 Code:  Bad RIP value.
 RIP  [<          (null)>]           (null)
  RSP <ffff880085757df0>
 CR2: 0000000000000000
 ---[ end trace ba5fc64319a826fb ]---

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2386,7 +2386,7 @@ slot_store(mdk_rdev_t *rdev, const char
 		if (rdev->raid_disk == -1)
 			return -EEXIST;
 		/* personality does all needed checks */
-		if (rdev->mddev->pers->hot_add_disk == NULL)
+		if (rdev->mddev->pers->hot_remove_disk == NULL)
 			return -EINVAL;
 		err = rdev->mddev->pers->
 			hot_remove_disk(rdev->mddev, rdev->raid_disk);



  parent reply	other threads:[~2011-06-16  7:11 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  0:29 [00/85] 2.6.33.15-longterm review Greg KH
2011-06-16  0:27 ` [02/85] kmemleak: Do not return a pointer to an object that kmemleak did not get Greg KH
2011-06-16  0:27 ` [03/85] [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks Greg KH
2011-06-16  0:28 ` [04/85] [CPUFREQ] Fix memory leak in cpufreq_stat Greg KH
2011-06-16  0:28 ` [05/85] powerpc/oprofile: Handle events that raise an exception without overflowing Greg KH
2011-06-16  0:28 ` [06/85] block: rescan partitions on invalidated devices on -ENOMEDIA Greg KH
2011-06-16  0:28 ` [07/85] block: add proper state guards to __elv_next_request Greg KH
2011-06-16  0:28 ` [08/85] mtd: mtdconcat: fix NAND OOB write Greg KH
2011-06-16  0:28 ` [09/85] x86, 64-bit: Fix copy_[to/from]_user() checks for the Greg KH
2011-06-16  0:28 ` [10/85] ext3: Fix fs corruption when make_indexed_dir() fails Greg KH
2011-06-16  0:28 ` [11/85] jbd: Fix forever sleeping process in do_get_write_access() Greg KH
2011-06-16  0:28 ` [12/85] jbd: fix fsync() tid wraparound bug Greg KH
2011-06-16  0:28 ` [13/85] ext4: release page cache in ext4_mb_load_buddy error path Greg KH
2011-06-16  0:28 ` [14/85] [SCSI] bnx2i: Fixed packet error created when the sq_size is Greg KH
2011-06-16  0:28 ` [15/85] [SCSI] Fix Ultrastor asm snippet Greg KH
2011-06-16  0:28 ` [16/85] x86, amd: Do not enable ARAT feature on AMD processors below Greg KH
2011-06-16  0:28 ` [17/85] x86, amd: Use _safe() msr access for GartTlbWlk disable code Greg KH
2011-06-16  0:28 ` [18/85] rcu: Fix unpaired rcu_irq_enter() from locking selftests Greg KH
2011-06-16  0:28 ` [19/85] staging: usbip: fix wrong endian conversion Greg KH
2011-06-16  0:28 ` [20/85] Fix for buffer overflow in ldm_frag_add not sufficient Greg KH
2011-06-16  0:28 ` [21/85] seqlock: Dont smp_rmb in seqlock reader spin loop Greg KH
2011-06-16  0:28 ` [22/85] time: Compensate for rounding on odd-frequency clocksources Greg KH
2011-06-16  0:28 ` [23/85] ALSA: HDA: Use one dmic only for Dell Studio 1558 Greg KH
2011-06-16  0:28 ` [24/85] ASoC: Ensure output PGA is enabled for line outputs in Greg KH
2011-06-16  0:28 ` [25/85] ASoC: Add some missing volume update bit sets for wm_hubs Greg KH
2011-06-16  0:28 ` [26/85] mm/page_alloc.c: prevent unending loop in Greg KH
2011-06-16  0:28 ` [27/85] loop: limit max_part module param to DISK_MAX_PARTS Greg KH
2011-06-16  0:28 ` [28/85] loop: handle on-demand devices correctly Greg KH
2011-06-16  0:28 ` [29/85] USB: moto_modem: Add USB identifier for the Motorola VE240 Greg KH
2011-06-16  0:28 ` [30/85] USB: serial: ftdi_sio: adding support for TavIR STK500 Greg KH
2011-06-16  0:28 ` [31/85] USB: gamin_gps: Fix for data transfer problems in native Greg KH
2011-06-16  0:28 ` [32/85] usb/gadget: at91sam9g20 fix end point max packet size Greg KH
2011-06-16  0:28 ` [33/85] usb: gadget: rndis: dont test against req->length Greg KH
2011-06-16  0:28 ` [34/85] xhci: Fix full speed bInterval encoding Greg KH
2011-06-16  0:28 ` [35/85] p54usb: add zoom 4410 usbid Greg KH
2011-06-16  0:28 ` [36/85] eCryptfs: Allow 2 scatterlist entries for encrypted Greg KH
2011-06-16  0:28 ` [37/85] UBIFS: fix a rare memory leak in ro to rw remounting path Greg KH
2011-06-16  0:28 ` [38/85] i8k: Avoid lahf in 64-bit code Greg KH
2011-06-16  0:28 ` [39/85] cpuidle: menu: fixed wrapping timers at 4.294 seconds Greg KH
2011-06-16  0:28 ` [40/85] dm table: reject devices without request fns Greg KH
2011-06-16  0:28 ` [41/85] ARM: 6941/1: cache: ensure MVA is cacheline aligned in Greg KH
2011-06-16  0:28 ` [57/85] ath9k: set 40 Mhz rate only if hw is configured in ht40 Greg KH
2011-06-16  0:28 ` [58/85] mm: fix ENOSPC returned by handle_mm_fault() Greg KH
2011-06-16  0:28 ` [59/85] PCI: Set PCIE maxpayload for card during hotplug insertion Greg KH
2011-06-16  0:28 ` [60/85] nl80211: fix check for valid SSID size in scan operations Greg KH
2011-06-16  0:28 ` [61/85] lockdep: Fix lock_is_held() on recursion Greg KH
2011-06-16  0:28 ` [62/85] drm/i915: Add a no lvds quirk for the Asus EeeBox PC EB1007 Greg KH
2011-06-16  0:28 ` [63/85] drm/radeon/kms: fix for radeon on systems >4GB without Greg KH
2011-06-16  0:29 ` [64/85] fat: Fix corrupt inode flags when remove ATTR_SYS flag Greg KH
2011-06-16  0:29 ` [65/85] xen: off by one errors in multicalls.c Greg KH
2011-06-16  0:29 ` [66/85] x86/amd-iommu: Use only per-device dma_ops Greg KH
2011-06-16  0:29 ` [67/85] x86/amd-iommu: Fix 3 possible endless loops Greg KH
2011-06-16  0:29 ` [68/85] x86/amd-iommu: Fix boot crash with hidden PCI devices Greg KH
2011-06-16  0:29 ` [69/85] USB: core: Tolerate protocol stall during hub and port Greg KH
2011-06-16  0:29 ` [70/85] USB: serial: add another 4N-GALAXY.DE PID to ftdi_sio driver Greg KH
2011-06-16  0:29 ` [71/85] USB: xhci - fix interval calculation for FS isoc endpoints Greg KH
2011-06-16  0:29 ` [72/85] ALSA: hda: Fix quirk for Dell Inspiron 910 Greg KH
2011-06-16  0:29 ` [73/85] oprofile, dcookies: Fix possible circular locking dependency Greg KH
2011-06-16  0:29 ` [74/85] CPUFREQ: Remove cpufreq_stats sysfs entries on module unload Greg KH
2011-06-16  0:29 ` Greg KH [this message]
2011-06-16  0:29 ` [76/85] md/raid5: fix raid5_set_bi_hw_segments Greg KH
2011-06-16  0:29 ` [77/85] md/raid5: fix FUA request handling in ops_run_io() Greg KH
2011-06-16  0:29 ` [78/85] pata_cmd64x: fix PIO setup Greg KH
2011-06-16  0:29 ` [79/85] pata_cmd64x: cmd648_bmdma_stop() fix Greg KH
2011-06-16  0:29 ` [80/85] pata_cmd64x: remove unused definitions Greg KH
2011-06-16  0:29 ` [81/85] pata_cm64x: fix boot crash on parisc Greg KH
2011-06-16  0:29 ` [82/85] xfs: properly account for reclaimed inodes Greg KH
2011-06-16  0:29 ` [83/85] netfilter: IPv6: initialize TOS field in REJECT target module Greg KH
2011-06-16  0:29 ` [84/85] netfilter: IPv6: fix DSCP mangle code Greg KH
2011-06-16  0:29 ` [85/85] [PATCH] Revert "iwlagn: Support new 5000 microcode." Greg KH

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=20110616002911.374643551@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=neilb@suse.de \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®