proc_fd_link, . , , systemtap. script:
probe kernel.function("proc_fd_link") {
print_backtrace();
}
fd/:
0xffffffffbb2cad70 : proc_fd_link+0x0/0xd0 [kernel]
0xffffffffbb2c4c3b : proc_pid_get_link+0x6b/0x90 [kernel] (inexact)
0xffffffffbb36341a : security_inode_follow_link+0x4a/0x70 [kernel] (inexact)
0xffffffffbb25bf13 : trailing_symlink+0x1e3/0x220 [kernel] (inexact)
0xffffffffbb25f559 : path_openat+0xe9/0x1380 [kernel] (inexact)
0xffffffffbb261af1 : do_filp_open+0x91/0x100 [kernel] (inexact)
0xffffffffbb26fd8f : __alloc_fd+0x3f/0x170 [kernel] (inexact)
0xffffffffbb24f280 : do_sys_open+0x130/0x220 [kernel] (inexact)
0xffffffffbb24f38e : sys_open+0x1e/0x20 [kernel] (inexact)
0xffffffffbb003c57 : do_syscall_64+0x67/0x160 [kernel] (inexact)
0xffffffffbb8039e1 : return_from_SYSCALL_64+0x0/0x6a [kernel] (inexact)
proc_pid_get_link :
if (!proc_fd_access_allowed(inode))
goto out;
aaaand
static int proc_fd_access_allowed(struct inode *inode)
{
struct task_struct *task;
int allowed = 0;
task = get_proc_task(inode);
if (task) {
allowed = ptrace_may_access(task, PTRACE_MODE_READ_FSCREDS);
put_task_struct(task);
}
return allowed;
}
, , ptrace.
, ? strace , ENXIO. git grep ENXIO fs/*. C :
static int no_open(struct inode *inode, struct file *file)
{
return -ENXIO;
}
, no_open, . , systemtap printf, . "" .