Page MenuHomeFreeBSD

Disallows SCTP socket for sendfile()
ClosedPublic

Authored by tuexen on Mar 13 2020, 11:19 AM.
Tags
None
Referenced Files
F103533260: D24059.id69488.diff
Tue, Nov 26, 4:52 AM
Unknown Object (File)
Sep 28 2024, 3:01 PM
Unknown Object (File)
Sep 23 2024, 7:42 AM
Unknown Object (File)
Sep 19 2024, 9:54 PM
Unknown Object (File)
Sep 17 2024, 3:26 AM
Unknown Object (File)
Sep 8 2024, 5:21 PM
Unknown Object (File)
Sep 8 2024, 4:36 AM
Unknown Object (File)
Sep 7 2024, 8:40 PM
Subscribers

Details

Summary

SCTP sockets were or were not supported by sendfile() in the past. However, at least since the rewrite of sendfile(), SCTP sockets can't be used in combination with sendfile(). So fail such calls indicating EINVAL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/kern_sendfile.c
581 ↗(On Diff #69473)

What exactly is the problem?

sys/kern/kern_sendfile.c
581 ↗(On Diff #69473)

Haven't looked at it, never used sendfile in combination with SCTP. If I remember it correctly, when @glebius rewrote the code, we had to do some changes related to sb_acc and sb_ccc. Right now we use

#define sb_cc sb_acc

At that point there was a discussion (if I remember it correctly) between rrs@ and glebius@ whether sendfile worked with SCTP before the rewrite or not. However, sendfile support doesn't work with SCTP sockets now as you can see in your syzkaller instance.
If you look at traces were SCTP is involved, you will find a set of crashes where calling sendfile() on an SCTP is involved. I want to mitigate these problems.

markj added inline comments.
sys/kern/kern_sendfile.c
581 ↗(On Diff #69473)

I see. Right, SCTP does not implement pru_ready, which is certainly a prerequisite.

This revision is now accepted and ready to land.Mar 13 2020, 5:12 PM
This revision was automatically updated to reflect the committed changes.