diff options
| author | Christian S.J. Peron <csjp@FreeBSD.org> | 2005-08-08 18:54:35 +0000 |
|---|---|---|
| committer | Christian S.J. Peron <csjp@FreeBSD.org> | 2005-08-08 18:54:35 +0000 |
| commit | 417ab24f788b99ae39aaa3a23a0b4c7692dfa991 (patch) | |
| tree | e24e3e4af6f172116d59211a4ae40974433ed719 /sys/kern/kern_sysctl.c | |
| parent | c1225b52f6a0f0ff6834dc34d5b6f94020097784 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_sysctl.c')
| -rw-r--r-- | sys/kern/kern_sysctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 522a55fe64c6..31482f800f1f 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1066,7 +1066,12 @@ sysctl_old_user(struct sysctl_req *req, const void *p, size_t l) req->oldidx += l; if (req->oldptr == NULL) return (0); - if (req->lock == REQ_LOCKED) + /* + * If we have not wired the user supplied buffer and we are currently + * holding locks, drop a witness warning, as it's possible that + * write operations to the user page can sleep. + */ + if (req->lock != REQ_WIRED) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "sysctl_old_user()"); i = l; |
