linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [RFC PATCH v2 1/8] landlock: Fix non-TCP sockets restriction
       [not found]       ` <62336067-18c2-3493-d0ec-6dd6a6d3a1b5@huawei-partners.com>
@ 2024-11-08 17:16         ` David Laight
  2024-12-04 19:29           ` Mickaël Salaün
  0 siblings, 1 reply; 2+ messages in thread
From: David Laight @ 2024-11-08 17:16 UTC (permalink / raw)
  To: 'Mikhail Ivanov', Mickaël Salaün,
	Matthieu Baerts, linux-sctp@vger.kernel.org
  Cc: gnoack@google.com, willemdebruijn.kernel@gmail.com,
	matthieu@buffet.re, linux-security-module@vger.kernel.org,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	yusongping@huawei.com, artem.kuzin@huawei.com,
	konstantin.meskhidze@huawei.com, MPTCP Linux

From: Mikhail Ivanov
> Sent: 31 October 2024 16:22
> 
> On 10/18/2024 9:08 PM, Mickaël Salaün wrote:
> > On Thu, Oct 17, 2024 at 02:59:48PM +0200, Matthieu Baerts wrote:
> >> Hi Mikhail and Landlock maintainers,
> >>
> >> +cc MPTCP list.
> >
> > Thanks, we should include this list in the next series.
> >
> >>
> >> On 17/10/2024 13:04, Mikhail Ivanov wrote:
> >>> Do not check TCP access right if socket protocol is not IPPROTO_TCP.
> >>> LANDLOCK_ACCESS_NET_BIND_TCP and LANDLOCK_ACCESS_NET_CONNECT_TCP
> >>> should not restrict bind(2) and connect(2) for non-TCP protocols
> >>> (SCTP, MPTCP, SMC).

I suspect you should check all IP protocols.
After all if TCP is banned why should SCTP be allowed?
Maybe you should have a different (probably more severe) restriction on SCTP.
You'd also need to look at the socket options used to add additional
local and remote IP addresses to a connect attempt.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH v2 1/8] landlock: Fix non-TCP sockets restriction
  2024-11-08 17:16         ` [RFC PATCH v2 1/8] landlock: Fix non-TCP sockets restriction David Laight
@ 2024-12-04 19:29           ` Mickaël Salaün
  0 siblings, 0 replies; 2+ messages in thread
From: Mickaël Salaün @ 2024-12-04 19:29 UTC (permalink / raw)
  To: David Laight
  Cc: 'Mikhail Ivanov', Matthieu Baerts,
	linux-sctp@vger.kernel.org, gnoack@google.com,
	willemdebruijn.kernel@gmail.com, matthieu@buffet.re,
	linux-security-module@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, yusongping@huawei.com,
	artem.kuzin@huawei.com, konstantin.meskhidze@huawei.com,
	MPTCP Linux

On Fri, Nov 08, 2024 at 05:16:50PM +0000, David Laight wrote:
> From: Mikhail Ivanov
> > Sent: 31 October 2024 16:22
> > 
> > On 10/18/2024 9:08 PM, Mickaël Salaün wrote:
> > > On Thu, Oct 17, 2024 at 02:59:48PM +0200, Matthieu Baerts wrote:
> > >> Hi Mikhail and Landlock maintainers,
> > >>
> > >> +cc MPTCP list.
> > >
> > > Thanks, we should include this list in the next series.
> > >
> > >>
> > >> On 17/10/2024 13:04, Mikhail Ivanov wrote:
> > >>> Do not check TCP access right if socket protocol is not IPPROTO_TCP.
> > >>> LANDLOCK_ACCESS_NET_BIND_TCP and LANDLOCK_ACCESS_NET_CONNECT_TCP
> > >>> should not restrict bind(2) and connect(2) for non-TCP protocols
> > >>> (SCTP, MPTCP, SMC).
> 
> I suspect you should check all IP protocols.
> After all if TCP is banned why should SCTP be allowed?
> Maybe you should have a different (probably more severe) restriction on SCTP.
> You'd also need to look at the socket options used to add additional
> local and remote IP addresses to a connect attempt.

Indeed, setsockopt()'s SCTP_SOCKOPT_BINDX_ADD and SCTP_SOCKOPT_CONNECTX
don't go through the socket_bind() nor socket_connect() LSM hooks bu the
security_sctp_bind_connect() hook instead.  This SCTP-specific hook is
not implemented for Landlock and the current implementation only
partially control such operations for SCTP.  This also make it clear
that we really need to stick to TCP-only for the TCP access rights.

It would be nice to add support for SCTP but we'll need to implement
security_sctp_bind_connect() and new tests with the setsockopt()
commands.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-04 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241017110454.265818-1-ivanov.mikhail1@huawei-partners.com>
     [not found] ` <20241017110454.265818-2-ivanov.mikhail1@huawei-partners.com>
     [not found]   ` <49bc2227-d8e1-4233-8bc4-4c2f0a191b7c@kernel.org>
     [not found]     ` <20241018.Kahdeik0aaCh@digikod.net>
     [not found]       ` <62336067-18c2-3493-d0ec-6dd6a6d3a1b5@huawei-partners.com>
2024-11-08 17:16         ` [RFC PATCH v2 1/8] landlock: Fix non-TCP sockets restriction David Laight
2024-12-04 19:29           ` Mickaël Salaün

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).