Skip to content

Commit d26e2f4

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: pm: in-kernel: avoid access entry without lock
In mptcp_pm_nl_set_flags(), "entry" is copied to "local" when pernet->lock is held to avoid direct access to entry without pernet->lock. Therefore, "local->flags" should be passed to mptcp_nl_set_flags instead of "entry->flags" when pernet->lock is not held, so as to avoid access to entry. Signed-off-by: Geliang Tang <[email protected]>
1 parent e62e41e commit d26e2f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mptcp/pm_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ int mptcp_pm_nl_set_flags(struct mptcp_pm_addr_entry *local,
19831983
*local = *entry;
19841984
spin_unlock_bh(&pernet->lock);
19851985

1986-
mptcp_nl_set_flags(net, &local->addr, entry->flags, changed);
1986+
mptcp_nl_set_flags(net, &local->addr, local->flags, changed);
19871987
return 0;
19881988
}
19891989

0 commit comments

Comments
 (0)