From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57820 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbbG3TQi (ORCPT ); Thu, 30 Jul 2015 15:16:38 -0400 Subject: Patch "dm stats: fix divide by zero if 'number_of_areas' arg is zero" has been added to the 3.14-stable tree To: mpatocka@redhat.com, gregkh@linuxfoundation.org, snitzer@redhat.com Cc: , From: Date: Thu, 30 Jul 2015 12:16:37 -0700 Message-ID: <143828379715498@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled dm stats: fix divide by zero if 'number_of_areas' arg is zero to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-stats-fix-divide-by-zero-if-number_of_areas-arg-is-zero.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From dd4c1b7d0c95be1c9245118a3accc41a16f1db67 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Fri, 5 Jun 2015 09:50:42 -0400 Subject: dm stats: fix divide by zero if 'number_of_areas' arg is zero From: Mikulas Patocka commit dd4c1b7d0c95be1c9245118a3accc41a16f1db67 upstream. If the number_of_areas argument was zero the kernel would crash on div-by-zero. Add better input validation. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-stats.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/md/dm-stats.c +++ b/drivers/md/dm-stats.c @@ -795,6 +795,8 @@ static int message_stats_create(struct m return -EINVAL; if (sscanf(argv[2], "/%u%c", &divisor, &dummy) == 1) { + if (!divisor) + return -EINVAL; step = end - start; if (do_div(step, divisor)) step++; Patches currently in stable-queue which might be from mpatocka@redhat.com are queue-3.14/dm-stats-fix-divide-by-zero-if-number_of_areas-arg-is-zero.patch queue-3.14/libata-increase-the-timeout-when-setting-transfer-mode.patch