mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Data race in net/mptcp/pm_netlink.c
@ 2024-11-22  7:34 clingfei
  2024-11-22 11:50 ` Matthieu Baerts
  0 siblings, 1 reply; 2+ messages in thread
From: clingfei @ 2024-11-22  7:34 UTC (permalink / raw)
  To: Matthieu Baerts, Mat Martineau, Geliang Tang, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev,
	mptcp, linux-kernel

linux-next weekly scan reports that there might be data race in
net/mptcp/pm_netlink.c, when mptcp_pm_nl_flush_addrs_doit
bitmap_zeroing pernet->id_bit_map at line 1748, there might be a
concurrent read at line 1864.
Should we add a lock to protect pernet->id_bit_map?

The report is listed below.
** CID 1601938:  Concurrent data access violations  (MISSING_LOCK)
/net/mptcp/pm_netlink.c: 1864 in mptcp_pm_nl_dump_addr()


________________________________________________________________________________________________________
*** CID 1601938:  Concurrent data access violations  (MISSING_LOCK)
/net/mptcp/pm_netlink.c: 1864 in mptcp_pm_nl_dump_addr()
1858     int i;
1859
1860     pernet = pm_nl_get_pernet(net);
1861
1862     rcu_read_lock();
1863     for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) {
>>>     CID 1601938:  Concurrent data access violations  (MISSING_LOCK)
>>>     Accessing "pernet->id_bitmap" without holding lock "pm_nl_pernet.lock". Elsewhere, "pm_nl_pernet.id_bitmap" is written to with "pm_nl_pernet.lock" held 1 out of 1 times.
1864     if (test_bit(i, pernet->id_bitmap)) {
1865     entry = __lookup_addr_by_id(pernet, i);
1866     if (!entry)
1867     break;
1868
1869     if (entry->addr.id <= id)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-22 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-22  7:34 Data race in net/mptcp/pm_netlink.c clingfei
2024-11-22 11:50 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®