mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
fprobe: Pass return address to the handlers
Pass return address as 'ret_ip' to the fprobe entry and return handlers so that the fprobe user handler can get the reutrn address without analyzing arch-dependent pt_regs. Link: https://lore.kernel.org/all/168507467664.913472.11642316698862778600.stgit@mhiramat.roam.corp.google.com/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
@@ -39,7 +39,8 @@ static noinline u32 fprobe_selftest_nest_target(u32 value, u32 (*nest)(u32))
|
||||
}
|
||||
|
||||
static notrace int fp_entry_handler(struct fprobe *fp, unsigned long ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
unsigned long ret_ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
{
|
||||
KUNIT_EXPECT_FALSE(current_test, preemptible());
|
||||
/* This can be called on the fprobe_selftest_target and the fprobe_selftest_target2 */
|
||||
@@ -57,6 +58,7 @@ static notrace int fp_entry_handler(struct fprobe *fp, unsigned long ip,
|
||||
}
|
||||
|
||||
static notrace void fp_exit_handler(struct fprobe *fp, unsigned long ip,
|
||||
unsigned long ret_ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
{
|
||||
unsigned long ret = regs_return_value(regs);
|
||||
@@ -78,14 +80,16 @@ static notrace void fp_exit_handler(struct fprobe *fp, unsigned long ip,
|
||||
}
|
||||
|
||||
static notrace int nest_entry_handler(struct fprobe *fp, unsigned long ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
unsigned long ret_ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
{
|
||||
KUNIT_EXPECT_FALSE(current_test, preemptible());
|
||||
return 0;
|
||||
}
|
||||
|
||||
static notrace void nest_exit_handler(struct fprobe *fp, unsigned long ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
unsigned long ret_ip,
|
||||
struct pt_regs *regs, void *data)
|
||||
{
|
||||
KUNIT_EXPECT_FALSE(current_test, preemptible());
|
||||
KUNIT_EXPECT_EQ(current_test, ip, target_nest_ip);
|
||||
|
Reference in New Issue
Block a user