mirror of
https://github.com/opnsense/src.git
synced 2026-05-19 08:25:22 -04:00
socket: Release cred reference later in sodealloc()
We dereference so->so_cred to update the per-uid socket buffer
accounting, so the crfree() call must be deferred until after that
point.
PR: 255869
(cherry picked from commit b295c5ddce)
This commit is contained in:
parent
b1304759ec
commit
e53b671b4f
1 changed files with 1 additions and 1 deletions
|
|
@ -475,7 +475,6 @@ sodealloc(struct socket *so)
|
|||
#endif
|
||||
hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE);
|
||||
|
||||
crfree(so->so_cred);
|
||||
khelp_destroy_osd(&so->osd);
|
||||
if (SOLISTENING(so)) {
|
||||
if (so->sol_accept_filter != NULL)
|
||||
|
|
@ -492,6 +491,7 @@ sodealloc(struct socket *so)
|
|||
SOCKBUF_LOCK_DESTROY(&so->so_snd);
|
||||
SOCKBUF_LOCK_DESTROY(&so->so_rcv);
|
||||
}
|
||||
crfree(so->so_cred);
|
||||
mtx_destroy(&so->so_lock);
|
||||
uma_zfree(socket_zone, so);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue