Skip to content

Commit 2658ce0

Browse files
bjdooks-ctAl Viro
authored andcommitted
fs/namespace: add __user to open_tree and move_mount syscalls
Thw open_tree and move_mount syscalls take names from the user, so add the __user to these to ensure the following warnings from sparse are fixed: fs/namespace.c:2392:35: warning: incorrect type in argument 2 (different address spaces) fs/namespace.c:2392:35: expected char const [noderef] <asn:1> *name fs/namespace.c:2392:35: got char const *filename fs/namespace.c:3541:38: warning: incorrect type in argument 2 (different address spaces) fs/namespace.c:3541:38: expected char const [noderef] <asn:1> *name fs/namespace.c:3541:38: got char const *from_pathname fs/namespace.c:3550:36: warning: incorrect type in argument 2 (different address spaces) fs/namespace.c:3550:36: expected char const [noderef] <asn:1> *name fs/namespace.c:3550:36: got char const *to_pathname Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent e200327 commit 2658ce0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/namespace.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,7 @@ static struct file *open_detached_copy(struct path *path, bool recursive)
23562356
return file;
23572357
}
23582358

2359-
SYSCALL_DEFINE3(open_tree, int, dfd, const char *, filename, unsigned, flags)
2359+
SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)
23602360
{
23612361
struct file *file;
23622362
struct path path;
@@ -3515,8 +3515,8 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
35153515
* Note the flags value is a combination of MOVE_MOUNT_* flags.
35163516
*/
35173517
SYSCALL_DEFINE5(move_mount,
3518-
int, from_dfd, const char *, from_pathname,
3519-
int, to_dfd, const char *, to_pathname,
3518+
int, from_dfd, const char __user *, from_pathname,
3519+
int, to_dfd, const char __user *, to_pathname,
35203520
unsigned int, flags)
35213521
{
35223522
struct path from_path, to_path;

0 commit comments

Comments
 (0)