netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 'Marcelo Ricardo Leitner' <marcelo.leitner@gmail.com>
To: David Laight <David.Laight@aculab.com>
Cc: Xin Long <lucien.xin@gmail.com>,
	network dev <netdev@vger.kernel.org>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc
Date: Fri, 25 Oct 2019 11:45:48 -0300	[thread overview]
Message-ID: <20191025144548.GC4250@localhost.localdomain> (raw)
In-Reply-To: <715b91a4a86547eb874874eda125c2ba@AcuMS.aculab.com>

On Fri, Oct 25, 2019 at 02:26:57PM +0000, David Laight wrote:
> From: 'Marcelo Ricardo Leitner'
> > Sent: 25 October 2019 14:22
> > On Fri, Oct 25, 2019 at 09:00:45AM +0000, David Laight wrote:
> > > 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
> >                            ^^^^^
> > 
> > You meant "is", right? Then we're agreeing.
> 
> No, I meant isn't.

Then you missed this detail in the patch. The default here IS to be
backwards compatible.

> The application must see a backwards compatible interface unless
> the application itself requests something different.
> The sysadmin can't be allowed to change the API seen by old applications.

Disagree. Sysadmins should be able to harden their systems as much as
they want/need. Yet, if that causes issues with old applications,
that's on them.

> 
> AFAICT if the protocol part of PF is enabled (which handles primary path
> failure better than the older version) and ' transport->state == SCTP_PF'
> is true then an old application binary will  get a completely unexpected -EACCESS
> rather than a valid state (out of the old valid states) if it requests 'peer addr_info'.
> 
> You cannot assume that just because some sysctl is set (because someone
> building a distribution suddenly decided it was a 'good idea') that an
> application binary will not fall in a big heap due to an error condition
> that couldn't ever happen before.

Agree, but that assumption doesn't have a room here. If the
distribution decided to harden the system, that's on them. Ditto for
many many other decisions, like having SELinux policies to block sshd
to bind only on port 22 and so, or for building the kernel without
SCTP_COOKIE_HMAC_MD5 because they think it's weak, etc.

  Marcelo

  reply	other threads:[~2019-10-25 14:45 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  6:14 [PATCHv3 net-next 0/5] sctp: update from rfc7829 Xin Long
2019-10-14  6:14 ` [PATCHv3 net-next 1/5] sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification Xin Long
2019-10-14  6:14   ` [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc Xin Long
2019-10-14  6:14     ` [PATCHv3 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt Xin Long
2019-10-14  6:14       ` [PATCHv3 net-next 4/5] sctp: add support for Primary Path Switchover Xin Long
2019-10-14  6:14         ` [PATCHv3 net-next 5/5] sctp: add SCTP_PEER_ADDR_THLDS_V2 sockopt Xin Long
2019-10-25  3:25         ` [PATCHv3 net-next 4/5] sctp: add support for Primary Path Switchover Marcelo Ricardo Leitner
2019-10-25  8:13           ` Xin Long
2019-10-25  3:24       ` [PATCHv3 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt Marcelo Ricardo Leitner
2019-10-25  8:05         ` Xin Long
2019-10-25  3:23     ` [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc Marcelo Ricardo Leitner
2019-10-25  8:02       ` Xin Long
2019-10-25  9:00       ` David Laight
2019-10-25 13:21         ` 'Marcelo Ricardo Leitner'
2019-10-25 14:26           ` David Laight
2019-10-25 14:45             ` 'Marcelo Ricardo Leitner' [this message]
2019-10-18 15:56   ` [PATCHv3 net-next 1/5] sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification David Laight
2019-10-19  8:55     ` Xin Long
2019-10-22 11:13       ` Xin Long
2019-10-25  3:22       ` Marcelo Ricardo Leitner
2019-10-25  7:58         ` Xin Long
2019-10-25  3:21   ` Marcelo Ricardo Leitner
2019-10-25  7:59     ` Xin Long
2019-10-14 12:42 ` [PATCHv3 net-next 0/5] sctp: update from rfc7829 Neil Horman
2019-10-16  0:56 ` David Miller
2019-10-16 10:42   ` David Laight
2019-10-17  4:56     ` Xin Long
2019-10-17  9:04       ` David Laight
2019-10-16 18:25 ` David Miller
2019-10-16 18:32   ` Marcelo Ricardo Leitner
2019-10-16 19:04     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025144548.GC4250@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).