On Tue, Jun 20, 2017 at 03:24:13PM +0200, Andreas Steinmetz wrote: > [please CC me, I'm not subscribed] > > It seems that if one does a getsockopt(SCTP_SOCKOPT_PEELOFF) a.k.a. > sctp_peeloff(), even if the socket descriptor from which the > association is to be peeled off has SOCK_CLOEXEC/SOCK_NONBLOCK set, > the peeled off socket descriptor doesn't have so. > > It would be advisable to either clone these flags or add an atomic > version of SCTP_SOCKOPT_PEELOFF (accept4() style). > > The missing SOCK_CLOEXEC requires unintentional additional locking > which typically is prone to errors and can slow down processing. > -- > Andreas Steinmetz SPAMmers use robotrap@xxxxxxxx > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > Try this patch, and confirm that it fixes the problem please? Thanks! Neil diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f16c8d9..a95e3d6 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4912,7 +4912,7 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp) return -EINVAL; /* Create a new socket. */ - err = sock_create(sk->sk_family, SOCK_SEQPACKET, IPPROTO_SCTP, &sock); + err = sock_create(sk->sk_family, sk->sk_type, IPPROTO_SCTP, &sock); if (err < 0) return err; -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html