BpfRingbuf.h - use exclusively locked map
As currently implemented, it is not safe to open (and mmap) the same kernel -> userspace ringbuffer multiple times. Note: it's likely, that as implemented, even a single instance is not thread safe without external locking. Test: TreeHugger, atest bpf_existence_test bpf_module_test bpf-time-in-state-tests libbpf_android_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Iea6908746a58e7412c0ce89da29a764aefeaef47
This commit is contained in:
parent
0fff839ae6
commit
fbaa3c9890
1 changed files with 1 additions and 1 deletions
|
|
@ -151,7 +151,7 @@ class BpfRingbuf : public BpfRingbufBase {
|
|||
|
||||
|
||||
inline base::Result<void> BpfRingbufBase::Init(const char* path) {
|
||||
mRingFd.reset(mapRetrieveRW(path));
|
||||
mRingFd.reset(mapRetrieveExclusiveRW(path));
|
||||
if (!mRingFd.ok()) {
|
||||
return android::base::ErrnoError()
|
||||
<< "failed to retrieve ringbuffer at " << path;
|
||||
|
|
|
|||
Loading…
Reference in a new issue