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: <201301181430.16142.arnd@arndb.de>
Date:	Fri, 18 Jan 2013 14:30:15 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 07/76] ARC: [optim] uaccess __{get,put}_user() optimised

On Friday 18 January 2013, Vineet Gupta wrote:
> Override asm-generic implementations. We basically gain on 2 fronts
> 
> * checks for alignment no longer needed as we are only doing "unit"
>   sized copies.
> 
>   (Careful observer could argue that While the kernel buffers are aligned,
>    the user buffer in theory might not be - however in that case the
>    user space is already broken when it tries to deref a hword/word
>    straddling word boundary - so we are not making it any worse).
> 
> * __copy_{to,from}_user( ) returns bytes that couldn't be copied,
>   whereas get_user() returns 0 for success or -EFAULT (not size). Thus
>   the code to do leftover bytes calculation can be avoided as well.

Interesting. I had thought that the compiler would be able to simplify
the calculation of the return value inline, but of course it cannot
because it has to be done inside the asm fixup.

> The savings were significant: ~17k of code.
> 
> bloat-o-meter vmlinux_uaccess_pre vmlinux_uaccess_post
> add/remove: 0/4 grow/shrink: 8/118 up/down: 1262/-18758 (-17496)
>                                                         ^^^^^^^^^
> Signed-off-by: Vineet Gupta <vgupta@...opsys.com>

Acked-by: Arnd Bergmann <arnd@...db.de>
--
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