Page MenuHomeFreeBSD

ktls: Fix an off-by-one bug in tls13_find_record_type()
ClosedPublic

Authored by markj on Thu, Sep 17, 4:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 6, 11:04 PM
Unknown Object (File)
Tue, Oct 6, 9:20 PM
Unknown Object (File)
Mon, Oct 5, 10:43 PM
Unknown Object (File)
Mon, Oct 5, 6:20 PM
Unknown Object (File)
Mon, Oct 5, 4:21 AM
Unknown Object (File)
Mon, Oct 5, 4:12 AM
Unknown Object (File)
Sun, Oct 4, 5:18 PM
Unknown Object (File)
Sat, Oct 3, 4:40 PM
Subscribers

Diff Detail

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

Event Timeline

markj requested review of this revision.Thu, Sep 17, 4:54 PM
This revision is now accepted and ready to land.Thu, Sep 17, 6:20 PM
sys/kern/uipc_ktls.c
2393

I wonder if it would have been clearer if I had written this as last_offset = offset + m_len - 1; originally as then then you wouldn't need the + 1 when computing trailer_len at the end and the expression you are fixing would have been correct (it is clearly wrong now). From the comment above the while loop it does seem like it should be offset of the last non-zero byte. Mostly because while reviewing this fix it took me a bit to understand what last_offset meant, and in particular the disconnect between m_len - 1 being the array index into cp but m_len being used to compute last_offset was a bit jarring when re-reading this.

tests/sys/kern/ktls_test.c
2837–2842

Maybe just make this a compound sentence so it reads easier

markj marked 2 inline comments as done.

Apply John's suggestions

This revision now requires review to proceed.Wed, Sep 23, 4:21 PM
This revision is now accepted and ready to land.Wed, Sep 23, 4:23 PM