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: <20140601.222534.1375636710740653884.davem@davemloft.net>
Date:	Sun, 01 Jun 2014 22:25:34 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	sshah@...arflare.com
Cc:	netdev@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: [PATCH net v3 1/2] sfc: use 64-bit writes for PIO.

From: Shradha Shah <sshah@...arflare.com>
Date: Thu, 29 May 2014 11:20:22 +0100

> +/* Copy in explicit 64-bit writes. */
> +static void efx_memcpy_64(void *dest, void *src, size_t len)
> +{
> +	uint64_t *src64 = src, *dest64 = dest;
> +	size_t i, l64 = len / 8;
> +
> +	WARN_ON_ONCE(len % 8 != 0);
> +	WARN_ON_ONCE(((u8 *)dest - (u8 *)0) % 8 != 0);
> +	BUILD_BUG_ON(sizeof(uint64_t) != 8);
> +
> +	for(i = 0; i < l64; ++i)
> +		dest64[i] = src64[i];
> +}

You absolutely, positively, cannot do this.

I/O memory pointers aren't pointers, they are opaque addresses, sparse
should have given you a loud warning about this.

On some platforms they are physical addresses, or some other special
value.

Therefore you cannot directly dereference them.

You _must_ use the io.h accessors.
--
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