get a userspace rbp register from kernel syscall

You can use the task_pt_regs() macro to get the current task’s user registers (saved at the moment of syscall entry):

#include <asm/processor.h>

SYSCALL_DEFINE1(foo, int, d)
{
    const struct pt_regs *user_regs = task_pt_regs(current);
    unsigned long rbp = user_regs->bp;

    /* Do whatever you need... */

    return 0;
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top