mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Lock Giant around userland_sysctl() to get the hostname in osf1_sysinfo()
so that the function is MP safe. The rest of the function doesn't need Giant.
This commit is contained in:
parent
19dde5cd3b
commit
b11c8f53dc
1 changed files with 5 additions and 0 deletions
|
|
@ -1781,6 +1781,9 @@ osf1_table(td, uap)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* MPSAFE
|
||||
*/
|
||||
int
|
||||
osf1_sysinfo(td, uap)
|
||||
struct thread *td;
|
||||
|
|
@ -1804,8 +1807,10 @@ osf1_sysinfo(td, uap)
|
|||
len = uap->count;
|
||||
name[0] = CTL_KERN;
|
||||
name[1] = KERN_HOSTNAME;
|
||||
mtx_lock(&Giant);
|
||||
retval = userland_sysctl(td, name, 2, uap->buf, &len,
|
||||
1, 0, 0, &bytes);
|
||||
mtx_unlock(&Giant);
|
||||
td->td_retval[0] = bytes;
|
||||
return(retval);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue