History

init: use do_mount() instead of ksys_mount()

In prepare_namespace(), do_mount() can be used instead of ksys_mount() as the first and third argument are const strings in the kernel, the second and fourth argument are passed through anyway, and the fifth argument is NULL. In do_mount_root(), ksys_mount() is called with the first and third argument being already kernelspace strings, which do not need to be copied over from userspace to kernelspace (again). The second and fourth arguments are passed through to do_mount() anyway. The fifth argument, while already residing in kernelspace, needs to be put into a page of its own. Then, do_mount() can be used instead of ksys_mount(). Once this is done, there are no in-kernel users to ksys_mount() left, which can therefore be removed.

Dominik Brodowski committed 8 years ago

Commit cccaa5e1 parent d4440aa3 files · +24 −16Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/syscalls.h+0−2
@@ -1231,8 +1231,6 @@ asmlinkage long sys_ni_syscall(void); · 1230 unmodified lines
1231 * the ksys_xyzyyz() functions prototyped below.1231 * the ksys_xyzyyz() functions prototyped below.
1232 */1232 */
1233 1233
1234int ksys_mount(const char __user *dev_name, const char __user *dir_name,
1235 const char __user *type, unsigned long flags, void __user *data);
1236int ksys_umount(char __user *name, int flags);1234int ksys_umount(char __user *name, int flags);
1237int ksys_dup(unsigned int fildes);1235int ksys_dup(unsigned int fildes);
1238int ksys_chroot(const char __user *filename);1236int ksys_chroot(const char __user *filename);

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