Skip to content

Commit

Permalink
Merge tag 'cfi-v5.14-rc7' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/kees/linux

Pull clang cfi fix from Kees Cook:

 - Use rcu_read_{un}lock_sched_notrace to avoid recursion (Elliot Berman)

* tag 'cfi-v5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  cfi: Use rcu_read_{un}lock_sched_notrace
  • Loading branch information
Linus Torvalds committed Aug 18, 2021
2 parents 3b84482 + 14c4c8e commit a83955b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/cfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ static inline cfi_check_fn find_shadow_check_fn(unsigned long ptr)
{
cfi_check_fn fn;

rcu_read_lock_sched();
rcu_read_lock_sched_notrace();
fn = ptr_to_check_fn(rcu_dereference_sched(cfi_shadow), ptr);
rcu_read_unlock_sched();
rcu_read_unlock_sched_notrace();

return fn;
}
Expand All @@ -269,11 +269,11 @@ static inline cfi_check_fn find_module_check_fn(unsigned long ptr)
cfi_check_fn fn = NULL;
struct module *mod;

rcu_read_lock_sched();
rcu_read_lock_sched_notrace();
mod = __module_address(ptr);
if (mod)
fn = mod->cfi_check;
rcu_read_unlock_sched();
rcu_read_unlock_sched_notrace();

return fn;
}
Expand Down

0 comments on commit a83955b

Please sign in to comment.