Re: [PATCH 0/3 v4] macvtap driver
From: Sridhar Samudrala <hidden>
Date: 2010-02-10 18:05:55
On Wed, 2010-02-10 at 15:48 +0100, Arnd Bergmann wrote:
On Monday 08 February 2010, Sridhar Samudrala wrote:quoted
I am also seeing this issue with net-next-2.6. Basically macvtap_put_user() and macvtap_get_user() call copy_to/from_user from within a RCU read-side critical section. The following patch fixes this issue by releasing the RCU read lock before calling these routines, but instead hold a reference to q->sk. Signed-off-by: Sridhar Samudrala <redacted>Yes, we need something like this, but we also need to protect the device from going away. The concept right now is to use file_get_queue to protect both the macvtap_queue and the macvlan_dev from going away. The sock_hold will keep the macvtap_queue around, but as far as I can tell, a user could still destroy the macvlan_dev using netlink at the same time, which still breaks.
may be we should do a dev_hold() in macvtap_set_queue() and dev_put() in macvtap_del_queue() so that the underlying device cannot go away as long the macvtap fd is open. Thanks Sridhar