From: David Laight Date: Fri, 25 Oct 2019 09:00:45 +0000 Subject: RE: [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc Message-Id: <995e44322af74c41bbff2c77338f83bf@AcuMS.aculab.com> List-Id: References: <20191025032337.GC4326@localhost.localdomain> In-Reply-To: <20191025032337.GC4326@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: 'Marcelo Ricardo Leitner' , Xin Long Cc: network dev , "linux-sctp@vger.kernel.org" , Neil Horman , "davem@davemloft.net" From: Marcelo Ricardo Leitner > Sent: 25 October 2019 04:24 ... > > @@ -5521,8 +5522,16 @@ static int sctp_getsockopt_peer_addr_info(struct sock *sk, int len, > > > > transport = sctp_addr_id2transport(sk, &pinfo.spinfo_address, > > pinfo.spinfo_assoc_id); > > - if (!transport) > > - return -EINVAL; > > + if (!transport) { > > + retval = -EINVAL; > > + goto out; > > + } > > + > > + if (transport->state = SCTP_PF && > > + transport->asoc->pf_expose = SCTP_PF_EXPOSE_DISABLE) { > > + retval = -EACCES; > > + goto out; > > + } > > As is on v3, this is NOT an UAPI violation. The user has to explicitly > set the system or the socket into the disabled state in order to > trigger this new check. Only because the default isn't to be backwards compatible with the old kernel and old applications. An old application running on a system that has the protocol parts of PF enabled mustn't see any PF events, states or obscure error returns. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)