Page MenuHomeFreeBSD

Disallows SCTP socket for sendfile()
ClosedPublic

Authored by tuexen on Mar 13 2020, 11:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 9:09 PM
Unknown Object (File)
Feb 16 2024, 7:38 PM
Unknown Object (File)
Dec 22 2023, 11:23 PM
Unknown Object (File)
Nov 4 2023, 1:59 PM
Unknown Object (File)
Sep 7 2023, 3:23 AM
Unknown Object (File)
Sep 7 2023, 3:20 AM
Unknown Object (File)
Sep 7 2023, 3:20 AM
Unknown Object (File)
Sep 1 2023, 6:21 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.