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] [day] [month] [year] [list]
Message-ID: <d8b35410-b5cc-b025-a943-d35614a52091@broadcom.com>
Date:	Thu, 4 Aug 2016 07:10:10 -0400
From:	"Rob (William) Rice" <rob.rice@...adcom.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>,
	Jassi Brar <jassisinghbrar@...il.com>,
	Rob Rice <rrice@...adcom.com>
Cc:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] mailbox: bcm-pdc: potential NULL dereference in
 pdc_shutdown()

Dan,

The fix looks good to me. Thanks for finding and fixing.

Rob

On 8/4/2016 1:30 AM, Dan Carpenter wrote:
> We can't pass NULL pointers to pdc_ring_free() so I moved the check for
> NULL.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c
> index cbe0c1e..c56d4d0 100644
> --- a/drivers/mailbox/bcm-pdc-mailbox.c
> +++ b/drivers/mailbox/bcm-pdc-mailbox.c
> @@ -1191,10 +1191,11 @@ static void pdc_shutdown(struct mbox_chan *chan)
>   {
>   	struct pdc_state *pdcs = chan->con_priv;
>   
> -	if (pdcs)
> -		dev_dbg(&pdcs->pdev->dev,
> -			"Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);
> +	if (!pdcs)
> +		return;
>   
> +	dev_dbg(&pdcs->pdev->dev,
> +		"Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);
>   	pdc_ring_free(pdcs);
>   }
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ