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:	Fri, 27 Feb 2009 16:32:45 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Uwe Kleine-Konig <u.kleine-koenig@...gutronix.de>
Cc:	kosaki.motohiro@...fujitsu.com, linux-kernel@...r.kernel.org,
	Steven Rostedt <rostedt@...dmis.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] make CALLER_ADDRx overwriteable

> The current definition of CALLER_ADDRx isn't suitable for all platforms.
> E.g. for ARM __builtin_return_address(N) doesn't work for N > 0 and
> AFAIK for powerpc there are no frame pointers needed to have a working
> __builtin_return_address.  This patch allows defining the CALLER_ADDRx
> macros in <asm/ftrace.h> and let these take precedence.
> 
> Because now <asm/ftrace.h> is included unconditionally in
> <linux/ftrace.h> all archs that don't already had this include get an
> empty one for free.

AFAIK, ia64 also doesn't work for N > 0.
thanks, good patch.



> -#ifdef CONFIG_FRAME_POINTER
> -/* TODO: need to fix this for ARM */
> -# define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
> -# define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
> -# define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2))
> -# define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3))
> -# define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4))
> -# define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5))
> -# define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6))
> -#else
> -# define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
> -# define CALLER_ADDR1 0UL
> -# define CALLER_ADDR2 0UL
> -# define CALLER_ADDR3 0UL
> -# define CALLER_ADDR4 0UL
> -# define CALLER_ADDR5 0UL
> -# define CALLER_ADDR6 0UL
> -#endif
> +#ifndef CALLER_ADDR0

but I think this "#ifndef CALLER_ADDR0" don't explain developer intention at all.
ARCH_HAS_XXXXX macro is better?

I would like to hear another developer opinions.


> +# ifdef CONFIG_FRAME_POINTER
> +#  define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
> +#  define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
> +#  define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2))
> +#  define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3))
> +#  define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4))
> +#  define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5))
> +#  define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6))
> +# else
> +#  define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
> +#  define CALLER_ADDR1 0UL
> +#  define CALLER_ADDR2 0UL
> +#  define CALLER_ADDR3 0UL
> +#  define CALLER_ADDR4 0UL
> +#  define CALLER_ADDR5 0UL
> +#  define CALLER_ADDR6 0UL
> +# endif
> +#endif /* ifndef CALLER_ADDR0 */




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