Skip to content

Commit

Permalink
macvtap: rcu_dereference outside read-lock section
Browse files Browse the repository at this point in the history
rcu_dereference occurs in update section. Replacement by
rcu_dereference_protected in order to prevent lockdep
complaint.

Found by Linux Driver Verification project (linuxtesting.org)

Signed-off-by: Denis Efremov <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
evdenis authored and davem330 committed Aug 12, 2012
1 parent 2359a47 commit 3a7f8c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ static int get_slot(struct macvlan_dev *vlan, struct macvtap_queue *q)
int i;

for (i = 0; i < MAX_MACVTAP_QUEUES; i++) {
if (rcu_dereference(vlan->taps[i]) == q)
if (rcu_dereference_protected(vlan->taps[i],
lockdep_is_held(&macvtap_lock)) == q)
return i;
}

Expand Down

0 comments on commit 3a7f8c3

Please sign in to comment.