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: <9dc07497-050d-1562-70bc-68daa460da67@opensource.wdc.com>
Date:   Tue, 12 Oct 2021 09:54:49 +0900
From:   Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Tejun Heo <htejun@...il.com>, Jeff Garzik <jeff@...zik.org>,
        linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] pata_legacy: fix a couple uninitialized variable bugs

On 10/6/21 16:34, Dan Carpenter wrote:
> The last byte of "pad" is used without being initialized.
> 
> Fixes: 55dba3120fbc ("libata: update ->data_xfer hook for ATAPI")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
>  drivers/ata/pata_legacy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index c3e6592712c4..b53f0e09783d 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -352,7 +352,7 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc,
>  			iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
>  
>  		if (unlikely(slop)) {
> -			__le32 pad;
> +			__le32 pad = 0;
>  			if (rw == READ) {
>  				pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
>  				memcpy(buf + buflen - slop, &pad, slop);
> @@ -742,7 +742,7 @@ static unsigned int vlb32_data_xfer(struct ata_queued_cmd *qc,
>  			ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
>  
>  		if (unlikely(slop)) {
> -			__le32 pad;
> +			__le32 pad = 0;
>  			if (rw == WRITE) {
>  				memcpy(&pad, buf + buflen - slop, slop);
>  				iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
> 

Applied to for-5.15-fixes. Thanks !
(Note: I added a blank line after the pad declaration to follow kernel
style).

-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ