Commit ef882bfe authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

x86/int3: Avoid atomic instrumentation

Use arch_atomic_*() and __READ_ONCE() to ensure nothing untoward
creeps in and ruins things.

That is; this is the INT3 text poke handler, strictly limit the code
that runs in it, lest it inadvertenly hits yet another INT3.

Reported-by: default avatarThomas Gleixner <>
Signed-off-by: default avatarPeter Zijlstra (Intel) <>
Signed-off-by: default avatarThomas Gleixner <>
Reviewed-by: default avatarMasami Hiramatsu <>
Reviewed-by: default avatarAlexandre Chartre <>
Acked-by: default avatarAndy Lutomirski <>

parent 4979fb53
......@@ -1014,9 +1014,9 @@ static struct bp_patching_desc *bp_desc;
static __always_inline
struct bp_patching_desc *try_get_desc(struct bp_patching_desc **descp)
struct bp_patching_desc *desc = READ_ONCE(*descp); /* rcu_dereference */
struct bp_patching_desc *desc = __READ_ONCE(*descp); /* rcu_dereference */
if (!desc || !atomic_inc_not_zero(&desc->refs))
if (!desc || !arch_atomic_inc_not_zero(&desc->refs))
return NULL;
return desc;
......@@ -1025,7 +1025,7 @@ struct bp_patching_desc *try_get_desc(struct bp_patching_desc **descp)
static __always_inline void put_desc(struct bp_patching_desc *desc)
static __always_inline void *text_poke_addr(struct text_poke_loc *tp)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment