Files
linux/kernel
Elliot Berman 5cd4b1ce23 UPSTREAM: cfi: Use rcu_read_{un}lock_sched_notrace
If rcu_read_lock_sched tracing is enabled, the tracing subsystem can
perform a jump which needs to be checked by CFI. For example, stm_ftrace
source is enabled as a module and hooks into enabled ftrace events. This
can cause an recursive loop where find_shadow_check_fn ->
rcu_read_lock_sched -> (call to stm_ftrace generates cfi slowpath) ->
find_shadow_check_fn -> rcu_read_lock_sched -> ...

To avoid the recursion, either the ftrace codes needs to be marked with
__no_cfi or CFI should not trace. Use the "_notrace" in CFI to avoid
tracing so that CFI can guard ftrace.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Cc: stable@vger.kernel.org
Fixes: cf68fffb66 ("add support for Clang CFI")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210811155914.19550-1-quic_eberman@quicinc.com

Bug: 194223154
Change-Id: I7d112496c7f503f95ba69390f6454623cf6dfed2
(cherry picked from commit 14c4c8e415)
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2021-08-19 21:20:03 +00:00
..
2021-05-13 14:22:11 +02:00
2021-04-14 08:41:58 +02:00
2021-05-27 08:36:46 +02:00
2021-06-12 14:48:14 +02:00
2020-08-26 09:10:39 -04:00
2021-05-13 14:22:11 +02:00
2020-08-12 10:58:02 -07:00
2020-11-14 11:26:04 -08:00
2021-01-13 10:28:55 +01:00
2020-07-27 14:31:12 -04:00
2021-06-03 18:47:38 +02:00
2021-02-07 15:37:17 +01:00
2021-05-20 15:35:25 +02:00
2021-04-15 14:23:41 +02:00