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: <20150506102502.GA1691@ares.olymp>
Date:	Wed, 6 May 2015 11:25:02 +0100
From:	Luis Henriques <luis.henriques@...onical.com>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	akpm@...ux-foundation.org, Mark Brown <broonie@...nel.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH 3.2 108/221] spi: dw-mid: avoid potential NULL dereference

On Tue, May 05, 2015 at 02:16:39AM +0100, Ben Hutchings wrote:
> 3.2.69-rc1 review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> 
> commit c9dafb27c84412fe4b17c3b94cc4ffeef5df1833 upstream.
> 
> When DMA descriptor allocation fails we should not try to assign any fields in
> the bad descriptor. The patch adds the necessary checks for that.
> 
> Fixes: 7063c0d942a1 (spi/dw_spi: add DMA support)
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Mark Brown <broonie@...nel.org>
> [bwh: Backported to 3.2: adjust context]
> Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
> ---
>  drivers/spi/spi-dw-mid.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> --- a/drivers/spi/spi-dw-mid.c
> +++ b/drivers/spi/spi-dw-mid.c
> @@ -155,6 +155,9 @@ static int mid_spi_dma_transfer(struct d
>  				1,
>  				DMA_TO_DEVICE,
>  				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
> +	if (!txdesc)
> +		return NULL;
> +

This backport doesn't look right to me as the function returns an int,
not a pointer.  OTOH, it seems like this return value is not checked
anywhere, which is why I dropped this patch in the 3.16 kernel.

Cheers,
--
Luís

>  	txdesc->callback = dw_spi_dma_done;
>  	txdesc->callback_param = dws;
>  
> @@ -177,6 +180,9 @@ static int mid_spi_dma_transfer(struct d
>  				1,
>  				DMA_FROM_DEVICE,
>  				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
> +	if (!rxdesc)
> +		return NULL;
> +
>  	rxdesc->callback = dw_spi_dma_done;
>  	rxdesc->callback_param = dws;
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
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