From b9b0f8db797b875d0c593b2e652bef96251645b4 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Tue, 29 Oct 2024 14:30:14 +0800 Subject: [PATCH] fix Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 77cbb9157d11..30e4cbddfed4 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1859,7 +1859,10 @@ static int mptcp_pm_nl_dump_addr(struct mptcp_id_bitmap *bitmap, struct pm_nl_pernet *pernet; pernet = pm_nl_get_pernet(net); + + spin_lock_bh(&pernet->lock); bitmap_copy(bitmap->map, pernet->id_bitmap.map, MPTCP_PM_MAX_ADDR_ID + 1); + spin_unlock_bh(&pernet->lock); return 0; } @@ -1883,8 +1886,7 @@ int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg, int i; id_bitmap = (struct mptcp_id_bitmap *)cb->ctx; - if (!id) - mptcp_pm_dump_addr(id_bitmap, info); + mptcp_pm_dump_addr(id_bitmap, info); for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) { if (test_bit(i, id_bitmap->map)) {