From 6fd82f26c2de20d39b826749277506a2b43675fa Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Sat, 30 Nov 2013 14:20:45 -0500 Subject: [PATCH] Fix mdadm soft lockup and crash (rhbz 1033971) --- kernel.spec | 7 +++ ...ags-more-safely-in-md_check_recovery.patch | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 md-test-mddev-flags-more-safely-in-md_check_recovery.patch diff --git a/kernel.spec b/kernel.spec index dde81136f..65c045e99 100644 --- a/kernel.spec +++ b/kernel.spec @@ -762,6 +762,9 @@ Patch25159: usbnet-fix-status-interrupt-urb-handling.patch Patch25161: inet-prevent-leakage-of-uninitialized-memory-to-user.patch Patch25162: inet-fix-addr_len-msg_namelen-assignment-in-recv_error-and-rxpmtu-functions.patch +#rhbz 1033971 +Patch25163: md-test-mddev-flags-more-safely-in-md_check_recovery.patch + # END OF PATCH DEFINITIONS %endif @@ -1492,6 +1495,9 @@ ApplyPatch usbnet-fix-status-interrupt-urb-handling.patch ApplyPatch inet-prevent-leakage-of-uninitialized-memory-to-user.patch ApplyPatch inet-fix-addr_len-msg_namelen-assignment-in-recv_error-and-rxpmtu-functions.patch +#rhbz 1033971 +ApplyPatch md-test-mddev-flags-more-safely-in-md_check_recovery.patch + # END OF PATCH APPLICATIONS %endif @@ -2296,6 +2302,7 @@ fi # || || %changelog * Sat Nov 30 2013 Josh Boyer +- Fix mdadm soft lockup and crash (rhbz 1033971) - CVE-2013-6405 net: leak of uninited mem to userspace via recv syscalls (rhbz 1035875 1035887) * Fri Nov 29 2013 Josh Boyer diff --git a/md-test-mddev-flags-more-safely-in-md_check_recovery.patch b/md-test-mddev-flags-more-safely-in-md_check_recovery.patch new file mode 100644 index 000000000..509c4dc01 --- /dev/null +++ b/md-test-mddev-flags-more-safely-in-md_check_recovery.patch @@ -0,0 +1,43 @@ +Bugzilla: 1033971 +Upstream-status: 3.13 (should hit 3.12 stable) + +From 142d44c310819e1965ca70b4d55d7679f5797e25 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 28 Nov 2013 10:34:18 +1100 +Subject: [PATCH] md: test mddev->flags more safely in md_check_recovery. + +commit 7a0a5355cbc71efa md: Don't test all of mddev->flags at once. +made most tests on mddev->flags safer, but missed one. + +When +commit 260fa034ef7a4ff8b7306 md: avoid deadlock when dirty buffers during md_stop. +added MD_STILL_CLOSED, this caused md_check_recovery to misbehave. +It can think there is something to do but find nothing. This can +lead to the md thread spinning during array shutdown. + +https://bugzilla.kernel.org/show_bug.cgi?id=65721 + +Reported-and-tested-by: Richard W.M. Jones +Fixes: 260fa034ef7a4ff8b7306 +Cc: stable@vger.kernel.org (3.12) +Signed-off-by: NeilBrown +--- + drivers/md/md.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/md/md.c b/drivers/md/md.c +index b6b7a28..e60cebf 100644 +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -7777,7 +7777,7 @@ void md_check_recovery(struct mddev *mddev) + if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) + return; + if ( ! ( +- (mddev->flags & ~ (1<flags & MD_UPDATE_SB_FLAGS & ~ (1<recovery) || + test_bit(MD_RECOVERY_DONE, &mddev->recovery) || + (mddev->external == 0 && mddev->safemode == 1) || +-- +1.8.3.1 +