OSDN Git Service

rethook: Fix to use WRITE_ONCE() for rethook:: Handler
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 31 Mar 2022 01:11:17 +0000 (10:11 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 31 Mar 2022 02:28:17 +0000 (19:28 -0700)
commita2fb49833cad07a53651c23dce508127085fae2d
treeda532f8277b15f581506b106a8159db0a10eb609
parent2609f635a20d3691e7b5725edc3bdadb7bedf8fb
rethook: Fix to use WRITE_ONCE() for rethook:: Handler

Since the function pointered by rethook::handler never be removed when
the rethook is alive, it doesn't need to use rcu_assign_pointer() to
update it. Just use WRITE_ONCE().

Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/164868907688.21983.1606862921419988152.stgit@devnote2
kernel/trace/rethook.c