From 46f7cb9d3b2bda20b9497c87e5bcd148fba12ca2 Mon Sep 17 00:00:00 2001 From: rwatson Date: Fri, 29 Dec 2006 10:37:32 +0000 Subject: Add a witness sleep warning to canon_path(), which invokes vput() and hence may perform an unbounded sleep. Remove an XXX comment suggesting that one be added. Obtained from: TrustedBSD Project --- sys/security/audit/audit_arg.c | 3 --- sys/security/audit/audit_bsm_klib.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/security') diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index 76aeb4d..f4f9373 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -669,9 +669,6 @@ audit_arg_upath(struct thread *td, char *upath, u_int64_t flag) if (ar == NULL) return; - /* - * XXXAUDIT: Witness warning for possible sleep here? - */ KASSERT((flag == ARG_UPATH1) || (flag == ARG_UPATH2), ("audit_arg_upath: flag %llu", (unsigned long long)flag)); KASSERT((flag != ARG_UPATH1) || (flag != ARG_UPATH2), diff --git a/sys/security/audit/audit_bsm_klib.c b/sys/security/audit/audit_bsm_klib.c index 7844ef9..809214f 100644 --- a/sys/security/audit/audit_bsm_klib.c +++ b/sys/security/audit/audit_bsm_klib.c @@ -488,6 +488,9 @@ canon_path(struct thread *td, char *path, char *cpath) struct filedesc *fdp; int cisr, error, vfslocked; + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "canon_path() at %s:%d", __FILE__, __LINE__); + fdp = td->td_proc->p_fd; bufp = path; cisr = 0; -- cgit v1.1