Page MenuHomeFreeBSD

Fix LOR
ClosedPublic

Authored by tuexen on Sun, Sep 12, 5:37 PM.

Details

Reviewers
markj
tuexen
Group Reviewers
transport
Commits
R10:29545986bdf6: sctp: avoid LOR
Summary

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

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.Sun, Sep 12, 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.