Don't automagically call vslock() from SYSCTL_OUT(). Instead, complain
about calls to SYSCTL_OUT() made with locks held if the buffer has not been pre-wired. SYSCTL_OUT() should not be called while holding locks, but if this is not possible, the buffer should be wired by calling sysctl_wire_old_buffer() before grabbing any locks.
This commit is contained in:
parent
3fa5d720d0
commit
b74f2c1878
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101422
@ -992,10 +992,8 @@ sysctl_old_user(struct sysctl_req *req, const void *p, size_t l)
|
||||
int error = 0;
|
||||
size_t i = 0;
|
||||
|
||||
if (req->lock == 1 && req->oldptr) {
|
||||
vslock(req->oldptr, req->oldlen);
|
||||
req->lock = 2;
|
||||
}
|
||||
if (req->lock == 1 && req->oldptr)
|
||||
WITNESS_SLEEP(1, NULL);
|
||||
if (req->oldptr) {
|
||||
i = l;
|
||||
if (req->oldlen <= req->oldidx)
|
||||
|
Loading…
Reference in New Issue
Block a user