Thread (18 messages) 18 messages, 7 authors, 2020-11-20

Re: violating function pointer signature

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2020-11-18 18:58:50
Also in: bpf, linux-toolchains, lkml

Possibly related (same subject, not in this thread)

On Wed, 18 Nov 2020 19:31:50 +0100
Florian Weimer [off-list ref] wrote:
* Segher Boessenkool:
quoted
On Wed, Nov 18, 2020 at 12:17:30PM -0500, Steven Rostedt wrote:  
quoted
I could change the stub from (void) to () if that would be better.  
Don't?  In a function definition they mean exactly the same thing (and
the kernel uses (void) everywhere else, which many people find clearer).  
And I think () functions expected a caller-provided parameter save
area on powerpc64le, while (void) functions do not.  It does not
matter for an empty function, but GCC prefers to use the parameter
save area instead of setting up a stack frame if it is present.  So
you get stack corruption if you call a () function as a (void)
function.  (The other way round is fine.)
I wonder if we should define on all architectures a void void_stub(void),
in assembly, that just does a return, an not worry about gcc messing up the
creation of the stub function.

On x86_64:

GLOBAL(void_stub)
	retq


And so on.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help