Re: [Patch net-next v2] net: fix dev_ifsioc_locked() race condition

2021-02-01 Thread Cong Wang
On Mon, Feb 1, 2021 at 7:40 PM Jakub Kicinski wrote: > > On Sat, 30 Jan 2021 18:27:55 -0800 Cong Wang wrote: > > From: Cong Wang > > > > dev_ifsioc_locked() is called with only RCU read lock, so when > > there is a parallel writer changing the mac address, it could > > get a partially updated mac

Re: [Patch net-next v2] net: fix dev_ifsioc_locked() race condition

2021-02-01 Thread Jakub Kicinski
On Sat, 30 Jan 2021 18:27:55 -0800 Cong Wang wrote: > From: Cong Wang > > dev_ifsioc_locked() is called with only RCU read lock, so when > there is a parallel writer changing the mac address, it could > get a partially updated mac address, as shown below: > > Thread 1 Thread

[Patch net-next v2] net: fix dev_ifsioc_locked() race condition

2021-01-30 Thread Cong Wang
From: Cong Wang dev_ifsioc_locked() is called with only RCU read lock, so when there is a parallel writer changing the mac address, it could get a partially updated mac address, as shown below: Thread 1Thread 2 // eth_commit_mac_addr_change() memcpy(dev->dev_addr, addr->s