Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
landlock: Fix non-TCP sockets restriction
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). sk_is_tcp() is used for this to check address family of the socket before doing INET-specific address length validation. This is required for error consistency. Closes: landlock-lsm#40 Fixes: fff69fb ("landlock: Support network rules with TCP bind and connect") Signed-off-by: Mikhail Ivanov <[email protected]>
- Loading branch information