Skip to content
Snippets Groups Projects
Commit d4e3b928 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

closures: CLOSURE_CALLBACK() to fix type punning


Control flow integrity is now checking that type signatures match on
indirect function calls. That breaks closures, which embed a work_struct
in a closure in such a way that a closure_fn may also be used as a
workqueue fn by the underlying closure code.

So we have to change closure fns to take a work_struct as their
argument - but that results in a loss of clarity, as closure fns have
different semantics from normal workqueue functions (they run owning a
ref on the closure, which must be released with continue_at() or
closure_return()).

Thus, this patc introduces CLOSURE_CALLBACK() and closure_type() macros
as suggested by Kees, to smooth things over a bit.

Suggested-by: default avatarKees Cook <keescook@chromium.org>
Cc: Coly Li <colyli@suse.de>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 98b1cc82
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment