Page MenuHomeFreeBSD

syzcaller found an interesting Invariant crash
ClosedPublic

Authored by rrs on May 13 2021, 10:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 12:23 AM
Unknown Object (File)
Nov 13 2024, 10:39 AM
Unknown Object (File)
Oct 24 2024, 1:13 AM
Unknown Object (File)
Sep 11 2024, 8:25 PM
Unknown Object (File)
Sep 11 2024, 8:25 PM
Unknown Object (File)
Sep 10 2024, 2:50 PM
Unknown Object (File)
Aug 29 2024, 8:48 PM
Unknown Object (File)
Aug 24 2024, 6:06 AM
Subscribers

Details

Summary

syzcaller came up with an interesting crash that has to do with sending
both a SYN and FIN together. Turns out there were actually two problems.

  1. Not splitting the flags when you clone off a new rsm the right way (SYN should go to the left edge and FIN should go to the right)
  2. a KASSERT that did not properly account for this case i.e. no mbuf/no data.
Test Plan

This pkt-drill script will currently cause a crash without the patch. With the
patch everything works as it should.

// https://syzkaller.appspot.com/bug?id=d7af235bf0fc9316b790bafe2a868fa7d69dfdc9
 0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 setsockopt(3, IPPROTO_TCP, TCP_FUNCTION_BLK, {function_set_name="rack",
                                                    pcbcnt=0}, 36) = 0
+0.00 sendto(3, ..., 0, MSG_EOF, ..., ...) = 0
+0.00 setsockopt(3,IPPROTO_TCP,TCP_NOOPT, [1], 4) = 0
+0.00 shutdown(3, SHUT_WR) = 0
+0.00 close(3) = 0

Diff Detail

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

Event Timeline

rrs requested review of this revision.May 13 2021, 10:58 AM
rrs added a reviewer: tuexen.
tuexen retitled this revision from Skyzall found an interesting Invariant crash to syzcaller found an interesting Invariant crash.
tuexen edited the summary of this revision. (Show Details)
tuexen edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.May 13 2021, 11:04 AM
This revision was automatically updated to reflect the committed changes.