FAILED: patch "[PATCH] mptcp: pm: ignore unknown endpoint flags" failed to apply to 5.10-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 0ace3297a7301911e52d8195cb1006414897c859
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025122924-retold-train-22bc@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 0ace3297a7301911e52d8195cb1006414897c859 Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Fri, 5 Dec 2025 19:55:14 +0100
Subject: [PATCH] mptcp: pm: ignore unknown endpoint flags
Before this patch, the kernel was saving any flags set by the userspace, even unknown ones. This doesn't cause critical issues because the kernel is only looking at specific ones. But on the other hand, endpoints dumps could tell the userspace some recent flags seem to be supported on older kernel versions.
Instead, ignore all unknown flags when parsing them. By doing that, the userspace can continue to set unsupported flags, but it has a way to verify what is supported by the kernel.
Note that it sounds better to continue accepting unsupported flags not to change the behaviour, but also that eases things on the userspace side by adding "optional" endpoint types only supported by newer kernel versions without having to deal with the different kernel versions.
A note for the backports: there will be conflicts in mptcp.h on older versions not having the mentioned flags, the new line should still be added last, and the '5' needs to be adapted to have the same value as the last entry.
include/uapi/linux/mptcp.h +1 -0
@@ -40,6 +40,7 @@#define MPTCP_PM_ADDR_FLAG_FULLMESH _BITUL(3)#define MPTCP_PM_ADDR_FLAG_IMPLICIT _BITUL(4)#define MPTCP_PM_ADDR_FLAG_LAMINAR _BITUL(5) +#define MPTCP_PM_ADDR_FLAGS_MASK GENMASK(5, 0)struct mptcp_info {__u8 mptcpi_subflows;
net/mptcp/pm_netlink.c +2 -1
@@ -119,7 +119,8 @@ int mptcp_pm_parse_entry(struct nlattr *attr, struct genl_info *info, }if (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]) - entry->flags =nla_get_u32 (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]); + entry->flags =nla_get_u32 (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]) & +MPTCP_PM_ADDR_FLAGS_MASK ;if (tb[MPTCP_PM_ADDR_ATTR_PORT ]) entry->addr.port =htons (nla_get_u16 (tb[MPTCP_PM_ADDR_ATTR_PORT ]));
Sasha Levin
maintainerPATCH 1/1 mptcp: pm: ignore unknown endpoint flags
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit 0ace3297a7301911e52d8195cb1006414897c859 ]
Before this patch, the kernel was saving any flags set by the userspace, even unknown ones. This doesn't cause critical issues because the kernel is only looking at specific ones. But on the other hand, endpoints dumps could tell the userspace some recent flags seem to be supported on older kernel versions.
Instead, ignore all unknown flags when parsing them. By doing that, the userspace can continue to set unsupported flags, but it has a way to verify what is supported by the kernel.
Note that it sounds better to continue accepting unsupported flags not to change the behaviour, but also that eases things on the userspace side by adding "optional" endpoint types only supported by newer kernel versions without having to deal with the different kernel versions.
A note for the backports: there will be conflicts in mptcp.h on older versions not having the mentioned flags, the new line should still be added last, and the '5' needs to be adapted to have the same value as the last entry.
--- include/uapi/linux/mptcp.h | 1 + net/mptcp/pm_netlink.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
include/uapi/linux/mptcp.h +1 -0
@@ -72,6 +72,7 @@ enum {#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2) +#define MPTCP_PM_ADDR_FLAGS_MASK GENMASK(2, 0)enum {MPTCP_PM_CMD_UNSPEC ,
net/mptcp/pm_netlink.c +2 -1
@@ -721,7 +721,8 @@ static int mptcp_pm_parse_addr(struct nlattr *attr, struct genl_info *info, entry->addr.id =nla_get_u8 (tb[MPTCP_PM_ADDR_ATTR_ID ]);if (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]) - entry->addr.flags =nla_get_u32 (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]); + entry->addr.flags =nla_get_u32 (tb[MPTCP_PM_ADDR_ATTR_FLAGS ]) & +MPTCP_PM_ADDR_FLAGS_MASK ;return 0 ; }
Signature · 1 line
2.51.0