<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/trace/rethook.c, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-06-29T07:04:30Z</updated>
<entry>
<title>rethook: Reject getting a rethook if RCU is not watching</title>
<updated>2022-06-29T07:04:30Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
</author>
<published>2022-06-07T16:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a077f273b5ac2a79e250a36f00f461527f516c4'/>
<id>urn:sha1:0a077f273b5ac2a79e250a36f00f461527f516c4</id>
<content type='text'>
[ Upstream commit c0f3bb4054ef036e5f67e27f2e3cad9e6512cf00 ]

Since the rethook_recycle() will involve the call_rcu() for reclaiming
the rethook_instance, the rethook must be set up at the RCU available
context (non idle). This rethook_recycle() in the rethook trampoline
handler is inevitable, thus the RCU available check must be done before
setting the rethook trampoline.

This adds a rcu_is_watching() check in the rethook_try_get() so that
it will return NULL if it is called when !rcu_is_watching().

Fixes: 54ecbe6f1ed5 ("rethook: Add a generic return hook")
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/bpf/165461827269.280167.7379263615545598958.stgit@devnote2
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rethook: Fix to use WRITE_ONCE() for rethook:: Handler</title>
<updated>2022-03-31T02:28:17Z</updated>
<author>
<name>Masami Hiramatsu</name>
</author>
<published>2022-03-31T01:11:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a2fb49833cad07a53651c23dce508127085fae2d'/>
<id>urn:sha1:a2fb49833cad07a53651c23dce508127085fae2d</id>
<content type='text'>
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 &lt;alexei.starovoitov@gmail.com&gt;
Signed-off-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/164868907688.21983.1606862921419988152.stgit@devnote2
</content>
</entry>
<entry>
<title>rethook: Add a generic return hook</title>
<updated>2022-03-18T03:16:29Z</updated>
<author>
<name>Masami Hiramatsu</name>
</author>
<published>2022-03-15T14:00:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54ecbe6f1ed5138c895bdff55608cf502755b20e'/>
<id>urn:sha1:54ecbe6f1ed5138c895bdff55608cf502755b20e</id>
<content type='text'>
Add a return hook framework which hooks the function return. Most of the
logic came from the kretprobe, but this is independent from kretprobe.

Note that this is expected to be used with other function entry hooking
feature, like ftrace, fprobe, adn kprobes. Eventually this will replace
the kretprobe (e.g. kprobe + rethook = kretprobe), but at this moment,
this is just an additional hook.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Tested-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/164735285066.1084943.9259661137330166643.stgit@devnote2
</content>
</entry>
</feed>
