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]
Date:   Mon, 24 Jan 2022 09:38:40 -0800
From:   Dave Hansen <dave.hansen@...el.com>
To:     Kuniyuki Iwashima <kuniyu@...zon.co.jp>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>
Cc:     Benjamin Herrenschmidt <benh@...zon.com>,
        Kuniyuki Iwashima <kuni1840@...il.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/boot: Avoid redundant address overlap tests in
 memcpy().

On 1/22/22 17:58, Kuniyuki Iwashima wrote:
> -void *memmove(void *dest, const void *src, size_t n)
> +void *____memmove(void *dest, const void *src, size_t n)
>   {
>   	unsigned char *d = dest;
>   	const unsigned char *s = src;
>   
> -	if (d <= s || d - s >= n)
> -		return ____memcpy(dest, src, n);
> -
>   	while (n-- > 0)
>   		d[n] = s[n];
>   
>   	return dest;
>   }

The ___ naming is pretty cruel.  Could we call it memmove_no_overlap() 
or memmove_unsafe()?  Surely we can put some *useful* bytes in the name 
rather than padding it out with _'s.  No need to perpetuate the 
____memcpy() naming.

Also, is this worth the churn?  It probably saves less than 10 
instructions, all of which are ridiculously cheap.  Is there a *reason* 
for this other than being a pure cleanup?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ