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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f420bff8-855a-aabe-924c-6d1b74f11001@gmail.com>
Date:   Wed, 24 Nov 2021 17:52:04 +1300
From:   Michael Schmitz <schmitzmic@...il.com>
To:     Finn Thain <fthain@...ux-m68k.org>,
        Damien Le Moal <damien.lemoal@...nsource.wdc.com>
Cc:     Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Jens Axboe <axboe@...nel.dk>, linux-ide@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pata_falcon: Add missing __iomem annotations

Hi Finn,

thanks for your patch!

On 24/11/21 17:25, Finn Thain wrote:
> The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
>
> drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
> drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
> drivers/ata/pata_falcon.c:58:41:    expected unsigned short volatile [noderef] [usertype] __iomem *port
> drivers/ata/pata_falcon.c:58:41:    got unsigned short [usertype] *
>
> The same thing shows up in 8 places, all told. Avoid this by use of
> __iomem type casts.

Seeing as data_addr was explicitly typed as __iomem, your fix is clearly 
correct. Bit embarrassing to have missed that (I remember adding __iomem 
annotations elsewhere at some stage).

If you think there's any need to test this change, say so.

Reviewed-by: Michael Schmitz <schmitzmic@...il.com>

>
> Cc: Michael Schmitz <schmitzmic@...il.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
> ---
>  drivers/ata/pata_falcon.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c
> index 121635aa8c00..e2a88edd9dbf 100644
> --- a/drivers/ata/pata_falcon.c
> +++ b/drivers/ata/pata_falcon.c
> @@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
>  	/* Transfer multiple of 2 bytes */
>  	if (rw == READ) {
>  		if (swap)
> -			raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
> +			raw_insw_swapw((u16 __iomem *)data_addr, (u16 *)buf, words);
>  		else
> -			raw_insw((u16 *)data_addr, (u16 *)buf, words);
> +			raw_insw((u16 __iomem *)data_addr, (u16 *)buf, words);
>  	} else {
>  		if (swap)
> -			raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
> +			raw_outsw_swapw((u16 __iomem *)data_addr, (u16 *)buf, words);
>  		else
> -			raw_outsw((u16 *)data_addr, (u16 *)buf, words);
> +			raw_outsw((u16 __iomem *)data_addr, (u16 *)buf, words);
>  	}
>
>  	/* Transfer trailing byte, if any. */
> @@ -74,16 +74,16 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
>
>  		if (rw == READ) {
>  			if (swap)
> -				raw_insw_swapw((u16 *)data_addr, (u16 *)pad, 1);
> +				raw_insw_swapw((u16 __iomem *)data_addr, (u16 *)pad, 1);
>  			else
> -				raw_insw((u16 *)data_addr, (u16 *)pad, 1);
> +				raw_insw((u16 __iomem *)data_addr, (u16 *)pad, 1);
>  			*buf = pad[0];
>  		} else {
>  			pad[0] = *buf;
>  			if (swap)
> -				raw_outsw_swapw((u16 *)data_addr, (u16 *)pad, 1);
> +				raw_outsw_swapw((u16 __iomem *)data_addr, (u16 *)pad, 1);
>  			else
> -				raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
> +				raw_outsw((u16 __iomem *)data_addr, (u16 *)pad, 1);
>  		}
>  		words++;
>  	}
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ