summaryrefslogtreecommitdiff
path: root/core/mdadm
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-04-27 22:24:53 +0000
committerroot <root@rshg047.dnsready.net>2011-04-27 22:24:53 +0000
commit18d6577d511b9a1ac36eaae50060133a401e42a3 (patch)
treef681f9444a7a0a95916de40af82d3b805d5fb8d3 /core/mdadm
parent69e1fada8bdc9588d0a3d8bc3403fa809d809a84 (diff)
Wed Apr 27 22:24:53 UTC 2011
Diffstat (limited to 'core/mdadm')
-rw-r--r--core/mdadm/PKGBUILD19
-rwxr-xr-xcore/mdadm/mdadm1
-rw-r--r--core/mdadm/segfault-3.2.1.patch68
3 files changed, 79 insertions, 9 deletions
diff --git a/core/mdadm/PKGBUILD b/core/mdadm/PKGBUILD
index d6c56b553..0455dce6e 100644
--- a/core/mdadm/PKGBUILD
+++ b/core/mdadm/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 117346 2011-03-31 06:36:59Z tpowa $
+# $Id: PKGBUILD 120375 2011-04-23 07:42:14Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=mdadm
pkgver=3.2.1
-pkgrel=1
+pkgrel=3
pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
arch=(i686 x86_64)
license=('GPL')
@@ -16,17 +16,14 @@ source=(ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.bz2
mdadm
mdadm.conf
mdadm_install
- mdadm_hook)
+ mdadm_hook
+ segfault-3.2.1.patch)
install=mdadm.install
replaces=('raidtools')
-md5sums=('d1e2549202bd79d9e99f1498d1109530'
- '7bff0e506fb6017510c8ec4a01896952'
- '00cbed931db4f15b6ce49e3e7d433966'
- '865c3d39e5f5dae58388160b563981f1'
- '1a3eb63832cecd6550f5b0a21d58cfdb')
build() {
cd $srcdir/$pkgname-$pkgver
+ patch -Np1 -i ../segfault-3.2.1.patch
make CXFLAGS="$CFLAGS"
}
@@ -43,3 +40,9 @@ package() {
make MDASSEMBLE_AUTO=1 mdassemble
install -D -m755 mdassemble $pkgdir/sbin/mdassemble
}
+md5sums=('d1e2549202bd79d9e99f1498d1109530'
+ '6df172c8f77b280018cf87eb3d313f29'
+ '00cbed931db4f15b6ce49e3e7d433966'
+ '865c3d39e5f5dae58388160b563981f1'
+ '1a3eb63832cecd6550f5b0a21d58cfdb'
+ '2fd25605bd1836a33c689ac442cb73ed')
diff --git a/core/mdadm/mdadm b/core/mdadm/mdadm
index 918a62537..e196f3642 100755
--- a/core/mdadm/mdadm
+++ b/core/mdadm/mdadm
@@ -13,7 +13,6 @@ case "$1" in
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
- mdadm --monitor --oneshot --scan
add_daemon mdadm
stat_done
fi
diff --git a/core/mdadm/segfault-3.2.1.patch b/core/mdadm/segfault-3.2.1.patch
new file mode 100644
index 000000000..6042d86c2
--- /dev/null
+++ b/core/mdadm/segfault-3.2.1.patch
@@ -0,0 +1,68 @@
+From 4019ad07013a5d8618b867f724d1c4a13c5cb05d Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Tue, 12 Apr 2011 18:28:01 +1000
+Subject: [PATCH] Monitor: avoid NULL dereference with 0.90 metadata
+
+0.90 array do not report the metadata type in /proc/mdstat, so
+we cannot assume that mse->metadata_version is non-NULL.
+
+So add an appropriate check.
+
+This adds an additional check missed by commit
+eb28e119b03fd5149886ed516fa4bb006ad3602e.
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ Monitor.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/Monitor.c b/Monitor.c
+index a3ea724..55aebeb 100644
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -577,7 +577,8 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
+ info[i].major = info[i].minor = 0;
+ }
+
+- if (strncmp(mse->metadata_version, "external:", 9) == 0 &&
++ if (mse->metadata_version &&
++ strncmp(mse->metadata_version, "external:", 9) == 0 &&
+ is_subarray(mse->metadata_version+9))
+ st->parent_dev =
+ devname2devnum(mse->metadata_version+10);
+--
+1.7.2.3
+
+From eb28e119b03fd5149886ed516fa4bb006ad3602e Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Tue, 5 Apr 2011 09:16:57 +1000
+Subject: [PATCH] Monitor: avoid NULL dereference with 0.90 metadata
+
+0.90 array do not report the metadata type in /proc/mdstat, so
+we cannot assume that mse->metadata_version is non-NULL.
+
+So add an appropriate check.
+
+Reported-by: Eugene <hdejin@yahoo.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ Monitor.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/Monitor.c b/Monitor.c
+index 291e465..337785d 100644
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -688,7 +688,8 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
+ st->devnum = mse->devnum;
+ st->percent = -2;
+ st->expected_spares = -1;
+- if (strncmp(mse->metadata_version, "external:", 9) == 0 &&
++ if (mse->metadata_version &&
++ strncmp(mse->metadata_version, "external:", 9) == 0 &&
+ is_subarray(mse->metadata_version+9))
+ st->parent_dev =
+ devname2devnum(mse->metadata_version+10);
+--
+1.7.2.3
+