Skip to content

Commit 1694a24

Browse files
matttbegregkh
authored andcommitted
mptcp: pm: deny endp with signal + subflow + port
commit 8af1f11 upstream. As mentioned in the 'Fixes' commit, the port flag is only supported by the 'signal' flag, and not by the 'subflow' one. Then if both the 'signal' and 'subflow' flags are set, the problem is the same: the feature cannot work with the 'subflow' flag. Technically, if both the 'signal' and 'subflow' flags are set, it will be possible to create the listening socket, but not to establish a subflow using this source port. So better to explicitly deny it, not to create some confusions because the expected behaviour is not possible. Fixes: 09f12c3 ("mptcp: allow to use port and non-signal in set_flags") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20240731-upstream-net-20240731-mptcp-endp-subflow-signal-v1-2-c8a9b036493b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 88ef794 commit 1694a24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/mptcp/pm_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,8 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info)
13281328
if (ret < 0)
13291329
return ret;
13301330

1331-
if (addr.addr.port && !(addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
1332-
GENL_SET_ERR_MSG(info, "flags must have signal when using port");
1331+
if (addr.addr.port && !address_use_port(&addr)) {
1332+
GENL_SET_ERR_MSG(info, "flags must have signal and not subflow when using port");
13331333
return -EINVAL;
13341334
}
13351335

0 commit comments

Comments
 (0)