• Kent Overstreet's avatar
    closures: CLOSURE_CALLBACK() to fix type punning · d4e3b928
    Kent Overstreet authored
    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>
    d4e3b928
writeback.c 28.2 KB