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: <48DD2F68.6000609@zytor.com>
Date:	Fri, 26 Sep 2008 11:52:24 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Joris van Rantwijk <jorispubl@...all.nl>
CC:	linux-kernel@...r.kernel.org
Subject: Re: Inflation of vmlinux by linker on x86_64

Joris van Rantwijk wrote:
>  #endif
> -			memcpy(dest,
> -			       output + phdr->p_offset,
> -			       phdr->p_filesz);
> +			src = output + phdr->p_offset;
> +
> +			/* order the copying to avoid overwriting */
> +			if ((direction == 1  && dest <= src) ||
> +			    (direction == -1 && dest > src)) {
> +				/* note: unlike standard memcpy, this one
> +				 * is safe to use when dest and src overlap.
> +				 */
> +				memcpy(dest, src, phdr->p_filesz);
> +			}
> +
>  			break;

Instead of adding a comment like this, we should simply rename it memmove().

Furthermore, we probably spend enough time copying that using a real 
memmove() implementation, using string instructions, would be good.

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ