Actions
Feature #3245
open127: value returned by rcu_dereference() is valid only within the enclosing RCU read-side critical section
Status:
New
Priority:
Normal
Assignee:
-
Start date:
07/20/2012
Due date:
% Done:
0%
Estimated time:
Published in build:
Description
From documentation:
Note that the value returned by rcu_dereference() is valid
only within the enclosing RCU read-side critical section.
For example, the following is not legal:
rcu_read_lock();
p = rcu_dereference(head.next);
rcu_read_unlock();
x = p->address;
rcu_read_lock();
y = p->data;
rcu_read_unlock();
Holding a reference from one RCU read-side critical section
to another is just as illegal as holding a reference from
one lock-based critical section to another! Similarly,
using a reference outside of the critical section in which
it was acquired is just as illegal as doing so with normal
locking.
Updated by Evgeny Novikov over 12 years ago
I guess, that this may be a good rule for pointer analysis. But we should think how to formalize this rule with help of CIF.
Actions