RE: [PATCH] megaraid:Fix possible NULL pointer deference in mraid_mm_ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@xxxxxxxxx]
> Sent: Wednesday, January 06, 2016 1:03 AM
> To: kashyap.desai@xxxxxxxxxxxxx
> Cc: sumit.saxena@xxxxxxxxxxxxx; uday.lingala@xxxxxxxxxxxxx;
> JBottomley@xxxxxxxx; martin.petersen@xxxxxxxxxx;
> megaraidlinux.pdl@xxxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: [PATCH] megaraid:Fix possible NULL pointer deference in
> mraid_mm_ioctl
>
> 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 <xerofoify@xxxxxxxxx>
> ---
>  drivers/scsi/megaraid/megaraid_mm.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/scsi/megaraid/megaraid_mm.c
> b/drivers/scsi/megaraid/megaraid_mm.c
> index a706927..215ddbc 100644
> --- a/drivers/scsi/megaraid/megaraid_mm.c
> +++ b/drivers/scsi/megaraid/megaraid_mm.c
> @@ -179,8 +179,12 @@ mraid_mm_ioctl(struct file *filep, unsigned int
cmd,
> unsigned long arg)
>
>  	/*
>  	 * 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.

Acked-by: Sumit Saxena <sumit.saxena@xxxxxxxxxxxxx>

> --
> 2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux