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, 18 Jan 2013 10:00:53 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Mike Frysinger" <vapier@...too.org>,
	<stephen.hemminger@...tta.com>, <netdev@...r.kernel.org>
Subject: RE: [PATCH v2] [iproute] ipxfrm: use alloca to allocate stack space

> Clang doesn't support the gcc extension for embeddeding flexible arrays
> inside of structures.  Use the slightly more portable alloca().
> 
> Signed-off-by: Mike Frysinger <vapier@...too.org>
> ---
> v2
> 	- use alloca rather than flexible arrays in structures
...
> +#include <alloca.h>

I'm not sure what happens in Linux, but alloca.h is likely
to try to use the libc version of alloca().
While that worked 20 years ago, these days compilers then
to use %sp relative addressing so you must only use the
compiler builtin alloca() code.

With gcc, compiling with -std=c89 (I think that is the one)
causes the builtin alloca() not to be defined.
By default alloca() is part of the language and the header
isn't needed.

Use of alloca() also stops some of the stack overwrite
protection being enabled.

In this case I suspect malloc() and free() is best.
(Or change the called function ...)

	David



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ