[ovs-discuss] ASAN RCU use-after-free

Ben Pfaff blp at ovn.org
Tue Jan 5 19:07:26 UTC 2021


On Tue, Jan 05, 2021 at 05:05:37PM +0200, Eli Britstein wrote:
> I am trying to use Address Sanitizer to detect issues.
> With a simple code of use-after-free it works, but with postponed free,
> there
> is no detection of the problem.

[...]

> This way it is up to a race between the RCU thread and the write of xx[1].
> Any thoughts of a better tool or technique that is more suitable?

The problem (I guess you realize this too) is that the normal ovsrcu
primitives only ensure that callbacks *can* be called, without actually
waiting for them to be called.

I don't think there's a way built into ovsrcu to make it safely wait for
all existing callbacks to execute.  I think that this would require
adding a new operation to the ovsrcu API.  It might be a good idea, if
you want to enable better checking here.  I think that the kernel RCU
API has something like this for enabling module unload.


More information about the discuss mailing list