From: NeilBrown <neilb@suse.de>
To: "Arkadiusz Miśkiewicz" <arekm@maven.pl>
Cc: linux-raid@vger.kernel.org
Subject: Re: mdadm segfault at assemble
Date: Thu, 16 Feb 2012 14:12:25 +1100 [thread overview]
Message-ID: <20120216141225.2fb47604@notabene.brown> (raw)
In-Reply-To: <201202150854.32303.arekm@maven.pl>
[-- Attachment #1: Type: text/plain, Size: 1962 bytes --]
On Wed, 15 Feb 2012 08:54:32 +0100 Arkadiusz Miśkiewicz <arekm@maven.pl>
wrote:
>
> Hi,
>
> mapfile.c:434
>
> struct mddev_ident *match = conf_match(st, info, NULL, 0, NULL);
>
> so devname is NULL and that's passed down to fnmatch in match_oneof causing
> segfault.
>
> Looked at git and it seems to be the same as in mine 3.2.3 version.
>
> Starting program: /sbin/mdadm --assemble --scan --auto=yes
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7ef9f15 in fnmatch () from /lib/libc.so.6
> (gdb) bt
> #0 0xb7ef9f15 in fnmatch () from /lib/libc.so.6
> #1 0x08051caf in match_oneof (devices=0x80dea79 ",/dev/sdb3", devname=0x0) at
> config.c:958
> #2 0x08052051 in conf_match (st=0x80def50, info=0x80e11b8, devname=0x0,
> verbose=0, rvp=0x0) at config.c:1049
> #3 0x080a8e0c in RebuildMap () at mapfile.c:434
> #4 0x080a865b in map_read (melp=0xbffff8a4) at mapfile.c:201
> #5 0x080a8526 in map_lock (melp=0xbffff8a4) at mapfile.c:145
> #6 0x0804e0f6 in main (argc=4, argv=0xbffffc54) at mdadm.c:1320
>
Thanks for the report.
This should fix it.
NeilBrown
commit 9f1b0f0f1ed0dd4752be65348a24971335cd50e8
Author: NeilBrown <neilb@suse.de>
Date: Thu Feb 16 14:11:57 2012 +1100
config: conf_match should ignore devname when not set.
mapfile:RebuildMap calls conf_match with no devname, so we must be
careful not to use it.
Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/config.c b/config.c
index 6027b2f..d8f48e1 100644
--- a/config.c
+++ b/config.c
@@ -1045,7 +1045,7 @@ struct mddev_ident *conf_match(struct supertype *st,
array_list->devname);
continue;
}
- if (array_list->devices &&
+ if (array_list->devices && devname &&
!match_oneof(array_list->devices, devname)) {
if (verbose >= 2 && array_list->devname)
fprintf(stderr, Name
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
parent reply other threads:[~2012-02-16 3:12 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <201202150854.32303.arekm@maven.pl>]
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=20120216141225.2fb47604@notabene.brown \
--to=neilb@suse.de \
--cc=arekm@maven.pl \
--cc=linux-raid@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).