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]
Date:	Wed, 28 May 2014 21:44:12 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Joel Porquet <joel@...quet.org>
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] asm-generic: uaccess: avoid name conflicts for strncpy and str(n)len

On Wednesday 28 May 2014 17:21:51 Joel Porquet wrote:
> asm-generic/uaccess.h defines 'strncpy_from_user', 'strnlen_user' and
> 'strlen_user' as static inline functions. It makes it impossible for an
> arch to include asm-generic/uaccess.h and benefits from its content, in
> addition to defining GENERIC_STRNCPY_FROM_USER and GENERIC_STRNLEN_USER.
> 
> Both configuration tokens respectively enable lib/strncpy_from_user.c
> and lib/strnlen_user.c which redefine the same symbols, causing
> redefinition errors at compilation.
> 
> This patch modifies asm-generic/uaccess.h so that strncpy_from_user is
> not defined when GENERIC_STRNCPY_FROM_USER is, and strnlen_user and
> strlen_user are not defined when GENERIC_STRNLEN_USER is, thus avoiding
> any name conflict.
> 
> At the moment, numerous archs, which make use of
> GENERIC_STRNCPY_FROM_USER and GENERIC_STRNLEN_USER, are forced to
> rewrite an entire asm/uaccess.h header because of this issue.
> 
> To the best of my knowledge, the following list of archs could benefit
> from this patch: x86, sh, openrisc, powerpc, arm64, arm, alpha, parisc,
> sparc, m68k.
> 
> Signed-off-by: Joel Porquet <joel@...quet.org>
> 

Acked-by: Arnd Bergmann <arnd@...db.de>

It makes sense to do this for any architecture that want's to use
this file, so feel free to add your patch the tree of whatever architecture
you want to convert.

Note however that asm/uaccess.h can't be implemented correctly in
generic code: you always need inline assembly to add the correct fixup
section magic.

	Arnd
--
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