Page MenuHomeFreeBSD

Fix LOR
ClosedPublic

Authored by tuexen on Sep 12 2021, 5:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 2:10 AM
Unknown Object (File)
Mar 4 2024, 8:09 AM
Unknown Object (File)
Dec 20 2023, 5:25 AM
Unknown Object (File)
Dec 14 2023, 8:39 PM
Unknown Object (File)
Nov 22 2023, 5:21 PM
Unknown Object (File)
Nov 22 2023, 4:39 PM
Unknown Object (File)
Nov 22 2023, 4:26 PM
Unknown Object (File)
Nov 21 2023, 7:40 PM

Details

Summary

Don't try to lock the inp-info lock while holding an stcb lock (and don't lock twice...)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

How was it getting locked twice?

How was it getting locked twice?

Because

SCTP_INP_INFO_RLOCK();
new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
SCTP_INP_INFO_RLOCK();

should have been

SCTP_INP_INFO_RLOCK();
new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
SCTP_INP_INFO_RUNLOCK();

(the difference is in the last line).

This revision is now accepted and ready to land.Sep 12 2021, 7:10 PM
This revision was automatically updated to reflect the committed changes.

How was it getting locked twice?

Because

SCTP_INP_INFO_RLOCK();
new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
SCTP_INP_INFO_RLOCK();

should have been

SCTP_INP_INFO_RLOCK();
new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
SCTP_INP_INFO_RUNLOCK();

(the difference is in the last line).

Oops, thanks.