lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131216214026.GA21685@kroah.com>
Date:	Mon, 16 Dec 2013 13:40:26 -0800
From:	Greg KH <gregkh@...uxfoundation.org>
To:	John Stultz <john.stultz@...aro.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Colin Cross <ccross@...roid.com>,
	Android Kernel Team <kernel-team@...roid.com>,
	kbuild test robot <fengguang.wu@...el.com>
Subject: Re: [RFC][PATCH 2/3] staging: ion: Fix possible null pointer
 dereference

On Mon, Dec 16, 2013 at 01:32:43PM -0800, John Stultz wrote:
> The kbuild test robot reported:
> 
> drivers/staging/android/ion/ion_system_heap.c:122 alloc_largest_available() error: potential null dereference 'info'.  (kmalloc returns null)
> 
> Where the pointer returned from kmalloc goes unchecked for failure.
> 
> This patch adds a simple check for a null return, and handles the error.
> 
> XXX: Not sure if continue or 'return NULL' is the right thing to do.
> 
> Cc: Colin Cross <ccross@...roid.com>
> Cc: Greg KH <gregkh@...uxfoundation.org>
> Cc: Android Kernel Team <kernel-team@...roid.com>
> Cc: kbuild test robot <fengguang.wu@...el.com>
> Reported-by: kbuild test robot <fengguang.wu@...el.com>
> Signed-off-by: John Stultz <john.stultz@...aro.org>
> ---
>  drivers/staging/android/ion/ion_system_heap.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
> index 144b2272..cc2e4da 100644
> --- a/drivers/staging/android/ion/ion_system_heap.c
> +++ b/drivers/staging/android/ion/ion_system_heap.c
> @@ -119,6 +119,11 @@ static struct page_info *alloc_largest_available(struct ion_system_heap *heap,
>  			continue;
>  
>  		info = kmalloc(sizeof(struct page_info), GFP_KERNEL);
> +		if(!info) {

Please don't add new coding style issues to staging drivers, the goal is
to clean them up, not make more mess :)

Care to resend this when you have figured out the XXX: line above?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ