diff -Nru mdadm-3.2.3/debian/changelog mdadm-3.2.3/debian/changelog --- mdadm-3.2.3/debian/changelog 2012-02-10 00:53:23.000000000 +0000 +++ mdadm-3.2.3/debian/changelog 2012-07-04 08:55:12.000000000 +0000 @@ -1,3 +1,11 @@ +mdadm (3.2.3-2ubuntu1.1) precise-proposed; urgency=low + + * debian/patches/fix_format_string_overflow: fix format string buffer + overflow in Monitor.c:check_array, which was causing crashes when there + were a large number of mismatches found (LP: #946758). + + -- Robie Basak Wed, 04 Jul 2012 08:52:40 +0000 + mdadm (3.2.3-2ubuntu1) precise; urgency=low * Merge from Debian testing. (LP: #920324) Remaining changes: diff -Nru mdadm-3.2.3/debian/patches/fix_format_string_overflow mdadm-3.2.3/debian/patches/fix_format_string_overflow --- mdadm-3.2.3/debian/patches/fix_format_string_overflow 1970-01-01 00:00:00.000000000 +0000 +++ mdadm-3.2.3/debian/patches/fix_format_string_overflow 2012-07-04 08:51:21.000000000 +0000 @@ -0,0 +1,34 @@ +From: Lukasz Dorau +Date: Wed, 11 Jan 2012 23:40:00 +0000 (+1100) +Subject: fix: Monitor sometimes crashes +X-Git-Tag: mdadm-3.2.4~109 +X-Git-Url: http://neil.brown.name/git?p=mdadm;a=commitdiff_plain;h=8453f8d0df0111cfd25e984afb7a64153b04bc27 + +fix: Monitor sometimes crashes + +The "char cnt [40]" buffer is sometimes too small to hold all message +- in such case monitor crashes. +The buffer must be larger to be able to hold all message. + +Signed-off-by: Lukasz Dorau +Signed-off-by: NeilBrown +--- +Origin: upstream, http://neil.brown.name/git?p=mdadm;a=commitdiff;h=8453f8d0df0111cfd25e984afb7a64153b04bc27 +Bug-Ubuntu: https://launchpad.net/bugs/946758 + +diff --git a/Monitor.c b/Monitor.c +index 8bc8824..77f22aa 100644 +--- a/Monitor.c ++++ b/Monitor.c +@@ -563,8 +563,9 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, + struct mdinfo *sra = + sysfs_read(-1, st->devnum, GET_MISMATCH); + if (sra && sra->mismatch_cnt > 0) { +- char cnt[40]; +- sprintf(cnt, " mismatches found: %d (on raid level %d)", ++ char cnt[80]; ++ snprintf(cnt, sizeof(cnt), ++ " mismatches found: %d (on raid level %d)", + sra->mismatch_cnt, array.level); + alert("RebuildFinished", dev, cnt, ainfo); + } else diff -Nru mdadm-3.2.3/debian/patches/series mdadm-3.2.3/debian/patches/series --- mdadm-3.2.3/debian/patches/series 2012-01-29 05:36:30.000000000 +0000 +++ mdadm-3.2.3/debian/patches/series 2012-07-04 08:50:03.000000000 +0000 @@ -2,3 +2,4 @@ debian/disable-udev-incr-assembly.diff -p1 debian/no-Werror.diff -p1 debian-changes-3.1.4-1+8efb9d1ubuntu4 +fix_format_string_overflow