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: <4751D566.7070703@pobox.com>
Date:	Sat, 01 Dec 2007 16:43:02 -0500
From:	Jeff Garzik <jgarzik@...ox.com>
To:	Thomas Bogendoerfer <tsbogend@...ha.franken.de>
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH] LIB82596: correct data types for hardware addresses

Thomas Bogendoerfer wrote:
> dma_addr_t is 64bit wide on some architectures (for example 64bit MIPS),
> so it's not a good idea to use it for 32bit wide addresses in descriptors.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
> ---
> 
>  drivers/net/lib82596.c |   50 ++++++++++++++++++++++++------------------------
>  1 files changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
> index 9a855e5..b59f442 100644
> --- a/drivers/net/lib82596.c
> +++ b/drivers/net/lib82596.c
> @@ -176,8 +176,8 @@ struct i596_reg {
>  struct i596_tbd {
>  	unsigned short size;
>  	unsigned short pad;
> -	dma_addr_t     next;
> -	dma_addr_t     data;
> +	u32            next;
> +	u32            data;
>  	u32 cache_pad[5];		/* Total 32 bytes... */
>  };

applied, though its incomplete for today's drivers.  I recommend 
converting those data types to the "sparse" data types that indicate 
endian-ness (see __le32, etc.).  Then verify that the code passes all 
sparse checks.

See Documentation/sparse.txt for more info.

Also, make sure it passes scripts/checkpatch.pl checks too, while you're 
at it...

Thanks,

	Jeff



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ