Skip to content

Commit 3f2f406

Browse files
committed
Merge branch 'mptcp-pm-fix-wrong-perm-and-sock-kfree'
Matthieu Baerts says: ==================== mptcp: pm: fix wrong perm and sock kfree Two small fixes related to the MPTCP path-manager: - Patch 1: remove an accidental restriction to admin users to list MPTCP endpoints. A regression from v6.7. - Patch 2: correctly use sock_kfree_s() instead of kfree() in the userspace PM. A fix for another fix introduced in v6.4 and backportable up to v5.19. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 256748d + 99635c9 commit 3f2f406

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

Documentation/netlink/specs/mptcp_pm.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ operations:
293293
doc: Get endpoint information
294294
attribute-set: attr
295295
dont-validate: [ strict ]
296-
flags: [ uns-admin-perm ]
297296
do: &get-addr-attrs
298297
request:
299298
attributes:

net/mptcp/mptcp_pm_gen.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ const struct genl_ops mptcp_pm_nl_ops[11] = {
112112
.dumpit = mptcp_pm_nl_get_addr_dumpit,
113113
.policy = mptcp_pm_get_addr_nl_policy,
114114
.maxattr = MPTCP_PM_ATTR_TOKEN,
115-
.flags = GENL_UNS_ADMIN_PERM,
116115
},
117116
{
118117
.cmd = MPTCP_PM_CMD_FLUSH_ADDRS,

net/mptcp/pm_userspace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ static int mptcp_userspace_pm_delete_local_addr(struct mptcp_sock *msk,
9191
struct mptcp_pm_addr_entry *addr)
9292
{
9393
struct mptcp_pm_addr_entry *entry, *tmp;
94+
struct sock *sk = (struct sock *)msk;
9495

9596
list_for_each_entry_safe(entry, tmp, &msk->pm.userspace_pm_local_addr_list, list) {
9697
if (mptcp_addresses_equal(&entry->addr, &addr->addr, false)) {
9798
/* TODO: a refcount is needed because the entry can
9899
* be used multiple times (e.g. fullmesh mode).
99100
*/
100101
list_del_rcu(&entry->list);
101-
kfree(entry);
102+
sock_kfree_s(sk, entry, sizeof(*entry));
102103
msk->pm.local_addr_used--;
103104
return 0;
104105
}

0 commit comments

Comments
 (0)