Fix panic with RACCT that could occur in low memory (or out of swap)
situations, due to fork1() calling racct_proc_exit() without calling racct_proc_fork() first. Submitted by: Mateusz Guzik <mjguzik at gmail dot com> (earlier version) Reviewed by: Mateusz Guzik <mjguzik at gmail dot com>
This commit is contained in:
parent
e27f871969
commit
ab27d5d88a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235787
@ -939,8 +939,8 @@ fork1(struct thread *td, int flags, int pages, struct proc **procp,
|
||||
#ifdef MAC
|
||||
mac_proc_destroy(newproc);
|
||||
#endif
|
||||
fail1:
|
||||
racct_proc_exit(newproc);
|
||||
fail1:
|
||||
if (vm2 != NULL)
|
||||
vmspace_free(vm2);
|
||||
uma_zfree(proc_zone, newproc);
|
||||
|
@ -573,6 +573,9 @@ racct_proc_fork(struct proc *parent, struct proc *child)
|
||||
PROC_UNLOCK(child);
|
||||
PROC_UNLOCK(parent);
|
||||
|
||||
if (error != 0)
|
||||
racct_proc_exit(child);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user