How to print user space stack trace in linux kernelspace

Let's say I connect to the sys_ * (e.g. sys_open) handler; when I find that the argument passed from user space is malicious, I print a stack trace in user space. How should I do it?

(dump_stack () only prints the kernel stack)

+2
source share
2 answers

oprofilehas support for stack trace of user space, and they are calculated in the kernel by moving stacks of user space. (But note: it does not allow characters that are executed by reporting tools in user space.)

, () oprofile / , .

, "" oprofile , .

0

(, SIGBUS, SIGKABRT), , .

:

 do_send_sig_info(SIGABRT, SEND_SIG_FORCED, current, true);

gdb, .

.

+2

All Articles