From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34746 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbcIINlL (ORCPT ); Fri, 9 Sep 2016 09:41:11 -0400 Subject: Patch "[PATCH 062/135] megaraid: Fix possible NULL pointer deference in" has been added to the 4.4-stable tree To: xerofoify@gmail.com, alexander.levin@verizon.com, gregkh@linuxfoundation.org, martin.petersen@oracle.com, sumit.saxena@avagotech.com Cc: , From: Date: Fri, 09 Sep 2016 15:38:13 +0200 Message-ID: <147342829316176@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 [PATCH 062/135] megaraid: Fix possible NULL pointer deference in to the 4.4-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: 0062-megaraid-Fix-possible-NULL-pointer-deference-in-mrai.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 301709c17bc50faa7f2c77797e454f3286d8ba39 Mon Sep 17 00:00:00 2001 From: Nicholas Krause Date: Tue, 5 Jan 2016 14:32:54 -0500 Subject: [PATCH 062/135] megaraid: Fix possible NULL pointer deference in mraid_mm_ioctl [ Upstream commit 7296f62f0322d808362b21064deb34f20799c20d ] This adds the needed check after the call to the function mraid_mm_alloc_kioc in order to make sure that this function has not returned NULL and therefore makes sure we do not deference a NULL pointer if one is returned by mraid_mm_alloc_kioc. Further more add needed comments explaining that this function call can return NULL if the list head is empty for the pointer passed in order to allow furture users to understand this required pointer check. Signed-off-by: Nicholas Krause Acked-by: Sumit Saxena Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/megaraid/megaraid_mm.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -179,8 +179,12 @@ mraid_mm_ioctl(struct file *filep, unsig /* * The following call will block till a kioc is available + * or return NULL if the list head is empty for the pointer + * of type mraid_mmapt passed to mraid_mm_alloc_kioc */ kioc = mraid_mm_alloc_kioc(adp); + if (!kioc) + return -ENXIO; /* * User sent the old mimd_t ioctl packet. Convert it to uioc_t. Patches currently in stable-queue which might be from xerofoify@gmail.com are queue-4.4/0062-megaraid-Fix-possible-NULL-pointer-deference-in-mrai.patch