HomeFreeBSD

pf: fix possibe SCTP panic

Description

pf: fix possibe SCTP panic

While processing SCTP packets we can enqueue work for later, in the
sctp_multihome_jobs queue. This deferred job includes a copy of the current
struct pf_pdesc, which must contain a valid pcksum pointer (in case of NAT).

However, jobs could be enqueued before we'd actually set this pointer in
pf_setup_pdesc(). Set this pointer before we scan the SCTP chunk headers (and
could enqueue deferred jobs.)

While here sprinkle in a few more assertions to ensure we got this right.

Reported-by: syzbot+974d0fb7e53c9aa31b90@syzkaller.appspotmail.com
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit dd2fc08d85431e10ad60e01e97b98e9dc23322bd)

Details

Provenance
kpAuthored on Thu, Oct 2, 2:48 PM
Parents
rG0cafc294bf12: zfs: merge openzfs/zfs@2f50d6740 (zfs-2.4-release) into stable/15
Branches
Unknown
Tags
Unknown