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: <CAPDyKFoY3Za2cOnmtbdOPY5RQ7pNbSVTxLx98cJ7F0d9S3v8Gw@mail.gmail.com>
Date:   Wed, 14 Sep 2016 12:52:32 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Peter Ujfalusi <peter.ujfalusi@...com>,
        Tony Lindgren <tony@...mide.com>, Kishon <kishon@...com>,
        linux-omap <linux-omap@...r.kernel.org>,
        linux-mmc <linux-mmc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid
 random data

On 14 September 2016 at 12:23, Arnd Bergmann <arnd@...db.de> wrote:
> On Wednesday, September 14, 2016 1:10:48 PM CEST Peter Ujfalusi wrote:
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index 24ebc9a8de89..0a5640156159 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -1409,7 +1409,7 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host,
>>  static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host,
>>                                         struct mmc_request *req)
>>  {
>> -       struct dma_slave_config cfg;
>> +       struct dma_slave_config cfg = {};
>>         struct dma_async_tx_descriptor *tx;
>>         int ret = 0, i;
>>         struct mmc_data *data = req->data;
>>
>
> This change looks correct and is certainly the simplest solution if you want to
> get it into v4.8, but generally speaking, I think it would be nicer to combine
> it with the initialization of the fields:
>
>         struct dma_slave_config cfg = {
>                   .src_addr = host->mapbase + OMAP_HSMMC_DATA;
>         .dst_addr = host->mapbase + OMAP_HSMMC_DATA;
>         .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
>         .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
>         .src_maxburst = data->blksz / 4;
>         .dst_maxburst = data->blksz / 4;
>         };

This seems like a small an easy change as well, so I wouldn't mind
picking up a v2 adopting this pattern instead.

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ