Page MenuHomeFreeBSD

Add barrier in buf ring peek function to prevent race in ARM and ARM64
ClosedPublic

Authored by mk_semihalf.com on Apr 17 2019, 9:06 AM.
Referenced Files
F97502402: D19932.id56270.diff
Sun, Sep 29, 6:45 PM
Unknown Object (File)
Fri, Sep 27, 4:41 PM
Unknown Object (File)
Fri, Sep 27, 11:55 AM
Unknown Object (File)
Fri, Sep 27, 10:14 AM
Unknown Object (File)
Wed, Sep 25, 6:37 AM
Unknown Object (File)
Mon, Sep 23, 10:37 AM
Unknown Object (File)
Fri, Sep 20, 1:00 AM
Unknown Object (File)
Sun, Sep 8, 1:50 PM

Details

Summary

The barrier is required on ARM and ARM64 to prevent reording of data
fetch, which could cause race between drbr_enqueue and drbr_peek.

If the buffer will be fetched in drbr_peek before checking if there are
buffers in the drbr ring, the invalid memory address could be stored, but the
condition could be true if the buffer will be added in the meantime in
the drbr_enqueue.
This will cause in returning invalid buffer address by drbr_peek.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Mark the code as ARM/ARM64 specific and change barrier, to order only loads.

Remove spurious comment about barrier

Yet another reincarnation of https://reviews.freebsd.org/rS302292 this time in peak_clear_sc
If no objections, I will commit this next week.

This revision is now accepted and ready to land.Apr 19 2019, 6:08 AM
This revision was automatically updated to reflect the committed changes.