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: <20250221171455.19b5be06@gandalf.local.home>
Date: Fri, 21 Feb 2025 17:14:55 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Martin Uecker <uecker@...raz.at>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, Greg KH
 <gregkh@...uxfoundation.org>, Boqun Feng <boqun.feng@...il.com>, "H. Peter
 Anvin" <hpa@...or.com>, Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
 Christoph Hellwig <hch@...radead.org>, rust-for-linux
 <rust-for-linux@...r.kernel.org>, Linus Torvalds
 <torvalds@...ux-foundation.org>, David Airlie <airlied@...il.com>,
 linux-kernel@...r.kernel.org, ksummit@...ts.linux.dev
Subject: Re: Rust kernel policy

On Fri, 21 Feb 2025 19:23:38 +0100
Martin Uecker <uecker@...raz.at> wrote:

> > where func is defined as:
> > 
> > 	void func(void) { return ; }  
> 
> Calling a function declared in this way with arguments
> would be rejected by the compiler, so I am not sure how
> this works now.
> 
> If you used 
> 
> void func();
> 
> to declare the function, this is not possible anymore in C23.

As the comment in the code states:

include/linux/static_call.h:

 *   This feature is strictly UB per the C standard (since it casts a function
 *   pointer to a different signature) and relies on the architecture ABI to
 *   make things work. In particular it relies on Caller Stack-cleanup and the
 *   whole return register being clobbered for short return values. All normal
 *   CDECL style ABIs conform.

Basically it's assigned via casts.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ