diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-22 04:29:07 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-22 04:29:07 +0000 |
commit | 8a33376794b4da9b66b8e399df42c8f38c02836b (patch) | |
tree | 2661b8e0345ebf4de79d034fdda1724137770e4a /sys/kern | |
parent | 6286ff7bea9e6220d4c974b5d38bc8282909db9c (diff) | |
download | FreeBSD-src-8a33376794b4da9b66b8e399df42c8f38c02836b.zip FreeBSD-src-8a33376794b4da9b66b8e399df42c8f38c02836b.tar.gz |
Acquire Giant in link() so that we can mark it as MSTD in
syscalls.master. Don't want to do it in kern_link() since the
Linux emulation code calls kern_link() after performing other
actions requiring Giant.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_extattr.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 10ff13f..38b21e4 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -1338,8 +1338,12 @@ link(td, uap) char *link; } */ *uap; { + int error; - return (kern_link(td, uap->path, uap->link, UIO_USERSPACE)); + mtx_lock(&Giant); + error = kern_link(td, uap->path, uap->link, UIO_USERSPACE); + mtx_unlock(&Giant); + return (error); } SYSCTL_DECL(_security_bsd); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 10ff13f..38b21e4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1338,8 +1338,12 @@ link(td, uap) char *link; } */ *uap; { + int error; - return (kern_link(td, uap->path, uap->link, UIO_USERSPACE)); + mtx_lock(&Giant); + error = kern_link(td, uap->path, uap->link, UIO_USERSPACE); + mtx_unlock(&Giant); + return (error); } SYSCTL_DECL(_security_bsd); |