SCTP updates
Subsystems (3)
cover SCTP updates
This set improves the SCTP socket API to be more in line with RFC6458, Geir and myself have finalized it eventually. While at it, the first patch also fixes two possible information leaks that should go to net tree as well. For more details, I refer you to the patches themselves.
Thanks a lot.
Daniel Borkmann (1):
net: sctp: fix information leaks in ulpevent layer
Geir Ola Vaagland (4):
net: sctp: implement rfc6458, 5.3.4. SCTP_SNDINFO cmsg support
net: sctp: implement rfc6458, 5.3.5. SCTP_RCVINFO cmsg support
net: sctp: implement rfc6458, 5.3.6. SCTP_NXTINFO cmsg support
net: sctp: implement rfc6458, 8.1.31. SCTP_DEFAULT_SNDINFO support
include/net/sctp/sctp.h | 1 + include/net/sctp/structs.h | 7 +- include/net/sctp/ulpevent.h | 14 +-- include/uapi/linux/sctp.h | 102 ++++++++++++---- net/sctp/socket.c | 285 ++++++++++++++++++++++++++++++++++++++------ net/sctp/ulpevent.c | 185 ++++++++++++---------------- 6 files changed, 423 insertions(+), 171 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 1/5 net: sctp: fix information leaks in ulpevent layer
While working on some other SCTP code, I noticed that some structures shared with user space are leaking uninitialized stack or heap buffer. In particular, struct sctp_sndrcvinfo has a 2 bytes hole between .sinfo_flags and .sinfo_ppid that remains unfilled by us in sctp_ulpevent_read_sndrcvinfo() when putting this into cmsg. But also struct sctp_remote_error contains a 2 bytes hole that we don't fill but place into a skb through skb_copy_expand() via sctp_ulpevent_make_remote_error().
Both structures are defined in RFC6458:
* Section 5.3.2. SCTP Header Information Structure:
The sctp_sndrcvinfo structure is defined below:
struct sctp_sndrcvinfo {
uint16_t sinfo_stream;
uint16_t sinfo_ssn;
uint16_t sinfo_flags;
<-- 2 bytes hole -->
uint32_t sinfo_ppid;
uint32_t sinfo_context;
uint32_t sinfo_timetolive;
uint32_t sinfo_tsn;
uint32_t sinfo_cumtsn;
sctp_assoc_t sinfo_assoc_id;
};* 6.1.3. SCTP_REMOTE_ERROR:
A remote peer may send an Operation Error message to its peer. This message indicates a variety of error conditions on an association. The entire ERROR chunk as it appears on the wire is included in an SCTP_REMOTE_ERROR event. Please refer to the SCTP specification [RFC4960] and any extensions for a list of possible error formats. An SCTP error notification has the following format:
struct sctp_remote_error {
uint16_t sre_type;
uint16_t sre_flags;
uint32_t sre_length;
uint16_t sre_error;
<-- 2 bytes hole -->
sctp_assoc_t sre_assoc_id;
uint8_t sre_data[];
};Fix this by setting both to 0 before filling them out. We also have other structures shared between user and kernel space in SCTP that contains holes (e.g. struct sctp_paddrthlds), but we copy that buffer over from user space first and thus don't need to care about it in that cases.
While at it, we can also remove lengthy comments copied from the draft, instead, we update the comment with the correct RFC number where one can look it up.
--- net/sctp/ulpevent.c | 122 +++++++--------------------------------------------- 1 file changed, 15 insertions(+), 107 deletions(-)
net/sctp/ulpevent.c +15 -107
@@ -366,9 +366,10 @@ fail:* specification [SCTP] and any extensions for a list of possible * error formats. */ -struct sctp_ulpevent *sctp_ulpevent_make_remote_error ( -const struct sctp_association *asoc,struct sctp_chunk *chunk, -__u16 flags,gfp_t gfp) +struct sctp_ulpevent * +sctp_ulpevent_make_remote_error (const struct sctp_association *asoc, +struct sctp_chunk *chunk,__u16 flags, +gfp_t gfp) {struct sctp_ulpevent *event;struct sctp_remote_error *sre;
@@ -387,8 +388,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(/* Copy the skb to a new skb with room for us to prepend * notification with. */ - skb =skb_copy_expand (chunk->skb,sizeof (struct sctp_remote_error ), -0 , gfp); + skb =skb_copy_expand (chunk->skb,sizeof (*sre),0 , gfp);/* Pull off the rest of the cause TLV from the chunk. */ skb_pull (chunk->skb, elen);
@@ -399,62 +399,21 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error( event =sctp_skb2event (skb);sctp_ulpevent_init (event,MSG_NOTIFICATION , skb->truesize); - sre = (struct sctp_remote_error *) -skb_push (skb,sizeof (struct sctp_remote_error )); + sre = (struct sctp_remote_error *)skb_push (skb,sizeof (*sre));/* Trim the buffer to the right length. */ -skb_trim (skb,sizeof (struct sctp_remote_error ) + elen); +skb_trim (skb,sizeof (*sre) + elen); -/* Socket Extensions for SCTP -* 5.3.1.3 SCTP_REMOTE_ERROR -* -* sre_type: -* It should be SCTP_REMOTE_ERROR. -*/ +/* RFC6458, Section 6.1.3. SCTP_REMOTE_ERROR */ +memset (sre,0 ,sizeof (*sre)); sre->sre_type =SCTP_REMOTE_ERROR ; - -/* -* Socket Extensions for SCTP -* 5.3.1.3 SCTP_REMOTE_ERROR -* -* sre_flags: 16 bits (unsigned integer) -* Currently unused. -*/ sre->sre_flags =0 ; - -/* Socket Extensions for SCTP -* 5.3.1.3 SCTP_REMOTE_ERROR -* -* sre_length: sizeof (__u32) -* -* This field is the total length of the notification data, -* including the notification header. -*/ sre->sre_length = skb->len; - -/* Socket Extensions for SCTP -* 5.3.1.3 SCTP_REMOTE_ERROR -* -* sre_error: 16 bits (unsigned integer) -* This value represents one of the Operational Error causes defined in -* the SCTP specification, in network byte order. -*/ sre->sre_error = cause; - -/* Socket Extensions for SCTP -* 5.3.1.3 SCTP_REMOTE_ERROR -* -* sre_assoc_id: sizeof (sctp_assoc_t) -* -* The association id field, holds the identifier for the association. -* All notifications for a given association have the same association -* identifier. For TCP style socket, this field is ignored. -*/ sctp_ulpevent_set_owner (event, asoc); sre->sre_assoc_id =sctp_assoc2id (asoc);return event; - fail:return NULL ; }
@@ -899,7 +858,9 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event)return notification->sn_header.sn_type; } -/* Copy out the sndrcvinfo into a msghdr. */ +/* RFC6458, Section 5.3.2. SCTP Header Information Structure +* (SCTP_SNDRCV, DEPRECATED) +*/ void sctp_ulpevent_read_sndrcvinfo (const struct sctp_ulpevent *event,struct msghdr *msghdr) {
@@ -908,74 +869,21 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,if (sctp_ulpevent_is_notification (event))return ; -/* Sockets API Extensions for SCTP -* Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) -* -* sinfo_stream: 16 bits (unsigned integer) -* -* For recvmsg() the SCTP stack places the message's stream number in -* this value. -*/ +memset (&sinfo,0 ,sizeof (sinfo)); sinfo.sinfo_stream = event->stream; -/* sinfo_ssn: 16 bits (unsigned integer) -* -* For recvmsg() this value contains the stream sequence number that -* the remote endpoint placed in the DATA chunk. For fragmented -* messages this is the same number for all deliveries of the message -* (if more than one recvmsg() is needed to read the message). -*/ sinfo.sinfo_ssn = event->ssn; -/* sinfo_ppid: 32 bits (unsigned integer) -* -* In recvmsg() this value is -* the same information that was passed by the upper layer in the peer -* application. Please note that byte order issues are NOT accounted -* for and this information is passed opaquely by the SCTP stack from -* one end to the other. -*/ sinfo.sinfo_ppid = event->ppid; -/* sinfo_flags: 16 bits (unsigned integer) -* -* This field may contain any of the following flags and is composed of -* a bitwise OR of these values. -* -* recvmsg() flags: -* -* SCTP_UNORDERED - This flag is present when the message was sent -* non-ordered. -*/ sinfo.sinfo_flags = event->flags; -/* sinfo_tsn: 32 bit (unsigned integer) -* -* For the receiving side, this field holds a TSN that was -* assigned to one of the SCTP Data Chunks. -*/ sinfo.sinfo_tsn = event->tsn; -/* sinfo_cumtsn: 32 bit (unsigned integer) -* -* This field will hold the current cumulative TSN as -* known by the underlying SCTP layer. Note this field is -* ignored when sending and only valid for a receive -* operation when sinfo_flags are set to SCTP_UNORDERED. -*/ sinfo.sinfo_cumtsn = event->cumtsn; -/* sinfo_assoc_id: sizeof (sctp_assoc_t) -* -* The association handle field, sinfo_assoc_id, holds the identifier -* for the association announced in the COMMUNICATION_UP notification. -* All notifications for a given association have the same identifier. -* Ignored for one-to-one style sockets. -*/ sinfo.sinfo_assoc_id =sctp_assoc2id (event->asoc); - -/* context value that is set via SCTP_CONTEXT socket option. */ +/* Context value that is set via SCTP_CONTEXT socket option. */ sinfo.sinfo_context = event->asoc->default_rcv_context; -/* These fields are not used while receiving. */ sinfo.sinfo_timetolive =0 ;put_cmsg (msghdr,IPPROTO_SCTP ,SCTP_SNDRCV , -sizeof (struct sctp_sndrcvinfo ), (void *)&sinfo); +sizeof (sinfo), &sinfo); }/* Do accounting for bytes received and hold a reference to the association
Signature · 1 line
1.7.11.7
PATCH 5/5 net: sctp: implement rfc6458, 8.1.31. SCTP_DEFAULT_SNDINFO support
In reply to Daniel BorkmannFrom: Geir Ola Vaagland <[email protected]>
This patch implements section 8.1.31. of RFC6458, which adds support for setting/retrieving SCTP_DEFAULT_SNDINFO:
Applications that wish to use the sendto() system call may wish to specify a default set of parameters that would normally be supplied through the inclusion of ancillary data. This socket option allows such an application to set the default sctp_sndinfo structure. The application that wishes to use this socket option simply passes the sctp_sndinfo structure (defined in Section 5.3.4) to this call. The input parameters accepted by this call include snd_sid, snd_flags, snd_ppid, and snd_context. The snd_flags parameter is composed of a bitwise OR of SCTP_UNORDERED, SCTP_EOF, and SCTP_SENDALL. The snd_assoc_id field specifies the association to which to apply the parameters. For a one-to-many style socket, any of the predefined constants are also allowed in this field. The field is ignored for one-to-one style sockets.
Joint work with Daniel Borkmann.
--- include/uapi/linux/sctp.h | 1 + net/sctp/socket.c | 107 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 99 insertions(+), 9 deletions(-)
include/uapi/linux/sctp.h +1 -0
@@ -97,6 +97,7 @@ typedef __s32 sctp_assoc_t;#define SCTP_PEER_ADDR_THLDS 31#define SCTP_RECVRCVINFO 32#define SCTP_RECVNXTINFO 33 +#define SCTP_DEFAULT_SNDINFO 34/* Internal Socket Options. Some of the sctp library functions are * implemented using these socket options.
net/sctp/socket.c +98 -9
162 lines not on this page · raw message
Signature · 1 line
1.7.11.7
Quoted 17 lines · Daniel Borkmann
This set improves the SCTP socket API to be more in line with RFC6458, Geir and myself have finalized it eventually. While at it, the first patch also fixes two possible information leaks that should go to net tree as well. For more details, I refer you to the patches themselves.
Thanks a lot.
Daniel Borkmann (1):
net: sctp: fix information leaks in ulpevent layerGeir Ola Vaagland (4):
net: sctp: implement rfc6458, 5.3.4.SCTP_SNDINFOcmsg support
net: sctp: implement rfc6458, 5.3.5.SCTP_RCVINFOcmsg support
net: sctp: implement rfc6458, 5.3.6.SCTP_NXTINFOcmsg support
net: sctp: implement rfc6458, 8.1.31.SCTP_DEFAULT_SNDINFOsupport
Quoted 16 lines
include/net/sctp/sctp.h | 1 + include/net/sctp/structs.h | 7 +- include/net/sctp/ulpevent.h | 14 +-- include/uapi/linux/sctp.h | 102 ++++++++++++---- net/sctp/socket.c | 285 ++++++++++++++++++++++++++++++++++++++------ net/sctp/ulpevent.c | 185 ++++++++++++---------------- 6 files changed, 423 insertions(+), 171 deletions(-)Signature · 6 lines
1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of SCTP_SNDRCVINFO too, so we can start to schedule its eventual removal?
Neil
On 07/08/2014 01:14 PM, Neil Horman wrote:
...
Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?
Sure, we can do that. Do you want me to include it into the set?
Quoted 8 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good. Neil
David Miller
maintainerFrom: Daniel Borkmann <[email protected]>
Date: Fri, 4 Jul 2014 23:05:03 +0200
Quoted 7 lines
This set improves the SCTP socket API to be more in line with RFC6458, Geir and myself have finalized it eventually. While at it, the first patch also fixes two possible information leaks that should go to net tree as well. For more details, I refer you to the patches themselves.
Thanks a lot.
Where are we with this series? Will there be another respin?
Quoted 9 lines · David Miller
From: Daniel Borkmann <[email protected]>
Date: Fri, 4 Jul 2014 23:05:03 +0200Quoted 6 lines
This set improves the SCTP socket API to be more in line with RFC6458, Geir and myself have finalized it eventually. While at it, the first patch also fixes two possible information leaks that should go to net tree as well. For more details, I refer you to the patches themselves.
Quoted 3 lines
Quoted 1 line
Thanks a lot.
Where are we with this series? Will there be another respin?
I'll add a 6th patch into the series to address Neil's feedback and will respin with the rest unchanged. I'll try to get to that by today. Thanks.
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our pr_warn_ratelimited(DEPRECATED ...) warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in SCTP_SNDRCVINFO as it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...
Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
Neil
From: Neil Horman
Quoted 6 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
The issue here is that it is an application API, not a system programming one. I'd guess that most sysfs stuff is only used by programs that are released as part of a Linux distribution - and thus code that is likely to be release with a matching kernel.
These sccp structures are much more likely to be used by 'proper' 3rd party applications, targeted at multiple kernel versions - possibly in binary form. We compile applications on the oldest linux version we think our customers are using - otherwise we'd have to release multiple copies.
So I don't think they can be deprecated (with warnings from the kernel) for a long time, perhaps 5 or 10 years!
The first stage would be (somehow) to generate warnings when applications are compiled. Only when that has been in place for some time would it make sense to generate kernel warnings.
David
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.
Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 6 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as AF_PACKET still has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
Neil
Quoted 46 lines · Neil Horman
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.
Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
That's a good question, not sure when this was decided, Vlad? ;)
Quoted 46 lines · Neil Horman
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.
Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
I think we can deprecate user API after a significantly long period of time (like 5 or 6 years). That's why we also have a deprecation schedule that can be updated and hopefully that's something people pay attention to.
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (SCTP_SNDRCVINFO vs SCTP_RCVINFO), I don't think there is any way to deprecate the SCTP_SNDRCVINFO since the event enabling it is the same as the one for SCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
-vlad
Quoted 8 lines
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 47 lines · Daniel Borkmann
Quoted 46 lines · Neil Horman
Quoted 45 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 6 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.
Quoted 6 lines
Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
That's a good question, not sure when this was decided, Vlad? ;)
Well, I did the deprecation warnings in SCTP a while ago, after we all discussed them, and there are lots of deprecation warnings spread out through the kernel that would adversely affect user space api if they were actually removed. I added the ones in the get/setsockopt paths under the impression that eventually they could be removed. If they can't ever be removed though, it really calls into question the use of a deprecation warning.
Neil
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 56 lines · Vlad Yasevich
Quoted 46 lines · Neil Horman
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
I think we can deprecate user API after a significantly long period of time (like 5 or 6 years). That's why we also have a deprecation schedule that can be updated and hopefully that's something people pay attention to.
Quoted 7 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the SCTP_RCVINFO data struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).
Neil
Quoted 16 lines
-vlad
Quoted 8 lines
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Neil Horman
...
Quoted 7 lines
Quoted 7 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Quoted 5 lines
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the
SCTP_RCVINFOdata struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).
Not from what I remember from when I read that RFC.
I think the lengths are different enough to determine which is which.
That RFC (I've forgotten the number) looks like an entire bag of poo that should be ignored...
David
On 07/09/2014 05:36 PM, Vlad Yasevich wrote:
...
Quoted 6 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Then the set could stay as is from my side.
Quoted 6 lines · David Laight
From: Neil Horman
...Quoted 4 lines
Quoted 4 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the
I don't think this is true:
To request SCTP_SNDRCVINFO you use the SCTP_EVENTS option. See
http://tools.ietf.org/html/rfc6458#section-6.2.1
To request the SCTP_RCVINFO you use the SCTP_RECVRCVINFO option. See
http://tools.ietf.org/html/rfc6458#section-8.1.29
So the user does different things and the kernel can provide the requested information.
Best regards
Michael
Quoted 24 lines
Quoted 8 lines
Quoted 3 lines
spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the
SCTP_RCVINFOdata struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).Not from what I remember from when I read that RFC.
I think the lengths are different enough to determine which is which.That RFC (I've forgotten the number) looks like an entire bag of poo that should be ignored...
David
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Michael Tuexen
Quoted 6 lines · David Laight
From: Neil Horman
...Quoted 4 lines
Quoted 4 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the
Quoted 7 lines
I don't think this is true:
To requestSCTP_SNDRCVINFOyou use theSCTP_EVENTSoption. See
http://tools.ietf.org/html/rfc6458#section-6.2.1
To request theSCTP_RCVINFOyou use theSCTP_RECVRCVINFOoption. See
http://tools.ietf.org/html/rfc6458#section-8.1.29
So the user does different things and the kernel can provide the requested information.
This is not very clear, but yes. I've re-re-read the section in question after sending out that mail and yes this does seem to be the case.
-vlad
Quoted 28 lines
Best regards
MichaelQuoted 24 lines
Quoted 8 lines
Quoted 3 lines
spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the
SCTP_RCVINFOdata struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).Not from what I remember from when I read that RFC.
I think the lengths are different enough to determine which is which.That RFC (I've forgotten the number) looks like an entire bag of poo that should be ignored...
David
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 64 lines · Neil Horman
Quoted 56 lines · Vlad Yasevich
Quoted 46 lines · Neil Horman
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
I think we can deprecate user API after a significantly long period of time (like 5 or 6 years). That's why we also have a deprecation schedule that can be updated and hopefully that's something people pay attention to.
Quoted 7 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.
Quoted 5 lines
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the
SCTP_RCVINFOdata struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control SCTP_RCVINFO. So would could add a deprecation warning to the over SCTP_EVENTS option and carry SCTP_SNDRCVINFO with it. Once SCTP_EVENTS goes away so can SCTP_SNDRCVINFO.
-vlad
Quoted 19 lines
Neil
Quoted 16 lines
-vlad
Quoted 8 lines
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 71 lines · Vlad Yasevich
Quoted 64 lines · Neil Horman
Quoted 56 lines · Vlad Yasevich
Quoted 46 lines · Neil Horman
Quoted 36 lines · Daniel Borkmann
Quoted 19 lines · Neil Horman
Quoted 18 lines · Daniel Borkmann
Quoted 10 lines · Neil Horman
Quoted 7 lines · Daniel Borkmann
On 07/08/2014 01:14 PM, Neil Horman wrote:
...Quoted 3 lines
since you're adding cmsg's from rfc6458, do you also want to add some deprecation warnings around the use of
SCTP_SNDRCVINFOtoo, so we can start to schedule its eventual removal?Sure, we can do that. Do you want me to include it into the set?
If you're plan is to implement 6458, then yes, I think that would be good.
Looking a bit closer at it, all our
pr_warn_ratelimited(DEPRECATED ...)warnings in SCTP are being done in 'slowpath' {set,get}sockopt(2) operations only, which is fine. What you're suggesting is to place similar ratelimited warnings (due to different possible pids on the machine) into the 'fastpath' where we get and set cmsg message headers.Quoted 8 lines
Quoted 6 lines
While that may be fine for {set,get}sockopt(2) that's called once or very few times, I'm not sure this is a good idea in
SCTP_SNDRCVINFOas it will yield to unnecessary spamming the klog since up to now this is the only way our users can set or receive this info. I'm not sure we want to annoy users like that ...Then we wrap it in a ONCE macro so that it only triggers on the first use instance.
I'm not convinced about this so far. The whole point is that we also provide the pid just as we currently do, so that we give the user a chance to possibly pin point the process that needs code change to not use the deprecated API anymore.
Quoted 3 lines
Quoted 3 lines
In how many years do you plan a removal ... I think we're stuck with uapi basically forever as we don't want to break old binaries, no? ;/
Quoted 9 lines
Quoted 3 lines
I thought we could remove things on a schedule if we followed the deprecation process, but that may just be for sysfs. Regardless, it would still be nice to inform people they are using an older api.
I think we rather might be stuck with also the deprecated stuff forever, just as
AF_PACKETstill has to carry around the old spkt stuff. :( So if we don't remove anything, there's actually also no point to spam the log about it, if everyone can/should read it from the RFC anyway.Quoted 4 lines
So this begs the question as to why we have deprecation warnings to begin with. At what point do we draw the line where we can change some aspect of the user api. I agree if the answer is never, then yeah we're stuck, but then, why bother announcing deprecation warnings at all?
I think we can deprecate user API after a significantly long period of time (like 5 or 6 years). That's why we also have a deprecation schedule that can be updated and hopefully that's something people pay attention to.
Quoted 7 lines
The problem here is deprecation of ancillary data and that's is a lot tougher then socket options. In this particular case (
SCTP_SNDRCVINFOvsSCTP_RCVINFO), I don't think there is any way to deprecate theSCTP_SNDRCVINFOsince the event enabling it is the same as the one forSCTP_RCVINFO. This was a mistake in the spec. Ancillary data should not have been enabled using even notification api, as it is not an event, but we now have to live with it.Quoted 5 lines
Ugh I didn't even consider cmsg type overlap. Thats probably it then, we can't deprecate it. Though that does call the question up as to how to differentiate expectations of the data format for each cmsg, if they use the same type. Does the
SCTP_RCVINFOdata struct overlay the SNDRCVINFO struct exactly? (sorry I've not checked myself yet).
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.
Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Neil
Quoted 23 lines
-vlad
Quoted 19 lines
Neil
Quoted 16 lines
-vlad
Quoted 8 lines
Neil
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Neil Horman
...
Quoted 7 lines
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Can you defer any deprecation warnings for a few kernel versions? This gives time for applications to be recoded.
Including argv[0] (even just the exec-time value) is much more use than the pid.
Actually this is 'right PITA' for an application.
A program binary that needs to work with old and new kernels will have to try the new option, and if it fails fall back to the old one, and then conditionally create/inspect the cmsg data.
I can't actually imagine anyone bothering!
Our sctp code is actually in a kernel module, so we can look at the kernel version when (part of) the driver is compiled on the target system.
David
Quoted 7 lines · David Laight
From: Neil Horman
...Quoted 5 lines
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.
Quoted 5 lines
Quoted 2 lines
Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Can you defer any deprecation warnings for a few kernel versions? This gives time for applications to be recoded.
I am fine either way, adding the warning a bit later seems fine, too.
Right now, even in-kernel users like dlm would hit it if we include it immediately.
Otherwise, I'll just add something like the below ...
net/sctp/socket.c +7 -2
@@ -2205,8 +2205,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,if (copy_from_user (&sctp_sk (sk)->subscribe, optval, optlen))return -EFAULT ; -/* -* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, +if (sctp_sk (sk)->subscribe.sctp_data_io_event) +pr_warn_ratelimited (DEPRECATED "%s (pid %d) " +"Requested SCTP_SNDRCVINFO event.\n" +"Use SCTP_RCVINFO through SCTP_RECVRCVINFO option instead.\n" , + current->comm,task_pid_nr (current)); + +/* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, * if there is no data to be sent or retransmit, the stack will * immediately send up this notification. */
Quoted 15 lines
Including argv[0] (even just the exec-time value) is much more use than the pid.
Actually this is 'right PITA' for an application.
A program binary that needs to work with old and new kernels will have to try the new option, and if it fails fall back to the old one, and then conditionally create/inspect the cmsg data.
I can't actually imagine anyone bothering!Our sctp code is actually in a kernel module, so we can look at the kernel version when (part of) the driver is compiled on the target system.
David
Quoted 7 lines · David Laight
From: Neil Horman
...Quoted 5 lines
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.
Quoted 5 lines
Quoted 2 lines
Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Can you defer any deprecation warnings for a few kernel versions? This gives time for applications to be recoded.
I'm not sure I understand the reasoning here? Why should a deprecation warning be delayed so you can recode your application? What about all the people who aren't subscribed this list? That just furhter delays their finding out about the deprecation.
Quoted 2 lines
Including argv[0] (even just the exec-time value) is much more use than the pid.
Thats fine, I think deprecation warnings usually have the form "[deprecated] pid %d(%s)..." where %s is argv[0].
Quoted 6 lines
Actually this is 'right PITA' for an application.
A program binary that needs to work with old and new kernels will have to try the new option, and if it fails fall back to the old one, and then conditionally create/inspect the cmsg data.
I can't actually imagine anyone bothering!
A deprecation warning is just that, a warning, it doesn't cause the old method to fail, its just a heads up to the application developer that they need to make a change sometime in the next 5 years. If you implement the new method in your application, you can wait for a reasonable period of time until you are confident that you application isn't being used on older kernels, or bump the minimal kernel version to run your app, and cut over to the new method.
Quoted 3 lines
Our sctp code is actually in a kernel module, so we can look at the kernel version when (part of) the driver is compiled on the target system.
You can do that too if you would like.
Neil
Quoted 5 lines
David
Quoted 14 lines · Daniel Borkmann
Quoted 7 lines · David Laight
From: Neil Horman
...Quoted 5 lines
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.Quoted 5 lines
Quoted 2 lines
Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Can you defer any deprecation warnings for a few kernel versions? This gives time for applications to be recoded.
Quoted 7 lines
I am fine either way, adding the warning a bit later seems fine, too.
Right now, even in-kernel users like dlm would hit it if we include it immediately.
Otherwise, I'll just add something like the below ...
This works for me, I don't see any reason to wait, and its a pretty easy changeover for most applications to make.
Thanks David.
Neil
Quoted 37 lines
net/sctp/socket.c +7
-2@@ -2205,8 +2205,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval,if (copy_from_user (&sctp_sk (sk)->subscribe, optval, optlen))return -EFAULT ; -/* -* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, +if (sctp_sk (sk)->subscribe.sctp_data_io_event) +pr_warn_ratelimited (DEPRECATED "%s (pid %d) " +"Requested SCTP_SNDRCVINFO event.\n" +"Use SCTP_RCVINFO through SCTP_RECVRCVINFO option instead.\n" , + current->comm,task_pid_nr (current)); + +/* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, * if there is no data to be sent or retransmit, the stack will * immediately send up this notification. */ Quoted 16 lines
Including argv[0] (even just the exec-time value) is much more use than the pid.
Actually this is 'right PITA' for an application.
A program binary that needs to work with old and new kernels will have to try the new option, and if it fails fall back to the old one, and then conditionally create/inspect the cmsg data.
I can't actually imagine anyone bothering!Our sctp code is actually in a kernel module, so we can look at the kernel version when (part of) the driver is compiled on the target system.
David
Quoted 41 lines · Daniel Borkmann
Quoted 7 lines · David Laight
From: Neil Horman
...Quoted 5 lines
Quoted 5 lines
No there is not direct overlap between the two. However, as Michael pointed out, there is a new option to control
SCTP_RCVINFO. So would could add a deprecation warning to the overSCTP_EVENTSoption and carrySCTP_SNDRCVINFOwith it. OnceSCTP_EVENTSgoes away so canSCTP_SNDRCVINFO.Quoted 5 lines
Quoted 2 lines
Ok, so we should still consider deprecation warnings then. Daniel, what about ratelimited warnings with pids included then?
Can you defer any deprecation warnings for a few kernel versions? This gives time for applications to be recoded.
I am fine either way, adding the warning a bit later seems fine, too.
Right now, even in-kernel users like dlm would hit it if we include it immediately.
Otherwise, I'll just add something like the below ...
net/sctp/socket.c +7
-2@@ -2205,8 +2205,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval, if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) return -EFAULT; -/* -* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, +if (sctp_sk (sk)->subscribe.sctp_data_io_event) +pr_warn_ratelimited (DEPRECATED "%s (pid %d) " +"Requested SCTP_SNDRCVINFO event.\n" +"Use SCTP_RCVINFO through SCTP_RECVRCVINFO option instead.\n" , + current->comm,task_pid_nr (current)); + +/* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, * if there is no data to be sent or retransmit, the stack will * immediately send up this notification.
Quoted 2 lines
*/
This is OK for step 1. Once we implement SCTP_EVENT, we can cover the rest of the events.
-vlad
Quoted 15 lines
Quoted 15 lines
Including argv[0] (even just the exec-time value) is much more use than the pid.
Actually this is 'right PITA' for an application.
A program binary that needs to work with old and new kernels will have to try the new option, and if it fails fall back to the old one, and then conditionally create/inspect the cmsg data.
I can't actually imagine anyone bothering!Our sctp code is actually in a kernel module, so we can look at the kernel version when (part of) the driver is compiled on the target system.
David