diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2003-10-08 16:30:02 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2003-10-08 16:30:02 +0000 |
commit | d1c48ebe3d27052387096d0811bcc4720e298b19 (patch) | |
tree | 3a7c387cb7cb5c8c72822d1b249478c29b261f05 /sys/kern/vfs_lookup.c | |
parent | ae27d3a1b8fd47fc48efc7cb21d1f0d7e52587c1 (diff) |
originally from cb@netbsd.org, adapted by provos
itojun@ ok
fix a race condition between path resolution in userland
and the subsequent namei(): inform the kernel portion of
valid filenames and then disallow symlink lookups for
those filenames by means of a hook in namei().
with suggestions from provos@
also, add (currently unused) seqnr field to struct
systrace_replace, from provos@
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r-- | sys/kern/vfs_lookup.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b87625b3918..96bcf0fc310 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_lookup.c,v 1.25 2003/06/02 23:28:07 millert Exp $ */ +/* $OpenBSD: vfs_lookup.c,v 1.26 2003/10/08 16:30:01 sturm Exp $ */ /* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */ /* @@ -54,6 +54,9 @@ #include <sys/ktrace.h> #endif +#include <dev/systrace.h> +#include "systrace.h" + /* * Convert a pathname into a pointer to a locked inode. * @@ -127,6 +130,10 @@ namei(ndp) if (KTRPOINT(cnp->cn_proc, KTR_NAMEI)) ktrnamei(cnp->cn_proc, cnp->cn_pnbuf); #endif +#if NSYSTRACE > 0 + if (ISSET(cnp->cn_proc->p_flag, P_SYSTRACE)) + systrace_namei(ndp); +#endif /* * Strip trailing slashes, as requested |