History

proc: proc_pid_ns takes super_block as an argument

syzbot found that touch /proc/testfile causes NULL pointer dereference at tomoyo_get_local_path() because inode of the dentry is NULL. Before c59f415a7cb6, Tomoyo received pid_ns from proc's s_fs_info directly. Since proc_pid_ns() can only work with inode, using it in the tomoyo_get_local_path() was wrong. To avoid creating more functions for getting proc_ns, change the argument type of the proc_pid_ns() function. Then, Tomoyo can use the existing super_block to get pid_ns.

Alexey Gladkov committed 6 years ago

Commit 9d78ede1 parent 2dd80839 files · +15 −15Browse files

Showing the changes to kernel (1 of 9 files). Show all

Unified · Split

kernel/fork.c+1−1
@@ -1745,7 +1745,7 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f) · 1744 unmodified lines
1745 pid_t nr = -1;1745 pid_t nr = -1;
1746 1746
1747 if (likely(pid_has_task(pid, PIDTYPE_PID))) {1747 if (likely(pid_has_task(pid, PIDTYPE_PID))) {
1748 ns = proc_pid_ns(file_inode(m->file));1748 ns = proc_pid_ns(file_inode(m->file)->i_sb);
1749 nr = pid_nr_ns(pid, ns);1749 nr = pid_nr_ns(pid, ns);
1750 }1750 }
1751 1751

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t