From e4d34b1e3bb477c429c4b125cb2451cdff90c2d3 Mon Sep 17 00:00:00 2001 From: Alex Cooper Date: Fri, 4 Feb 2022 12:51:10 -0800 Subject: [PATCH] Add CFI-ICALL to needed PipeWire methods Adds missing RTC_NO_SANITIZE("cfi-icall") attributes to a few needed functions for PipeWire initialization. These are methods that call (or call methods that end up inlined and call) function pointers as a result of dlopen'ing a lib. For ShareScreencastStream, the generated InitializeStubs method appears to trigger this; while the egl_dmabuf destructor appears to need this due to the EglDestroyContext and EglTerminate calls that it makes. Bug: webrtc:13659 Change-Id: Idb4af985293224957a50d17d9042524af2b66138 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250702 Auto-Submit: Alexander Cooper Reviewed-by: Mark Foltz Commit-Queue: Mark Foltz Cr-Commit-Position: refs/heads/main@{#35918} --- modules/desktop_capture/linux/wayland/egl_dmabuf.cc | 1 + .../desktop_capture/linux/wayland/shared_screencast_stream.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc index ac710be65c..a4de19d1ad 100644 --- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -418,6 +418,7 @@ EglDmaBuf::EglDmaBuf() { egl_initialized_ = true; } +RTC_NO_SANITIZE("cfi-icall") EglDmaBuf::~EglDmaBuf() { if (gbm_device_) { gbm_device_destroy(gbm_device_); diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index 43ad756bbd..8fae69ed9c 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -26,6 +26,7 @@ #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" +#include "rtc_base/sanitizer.h" #include "rtc_base/string_encode.h" #include "rtc_base/string_to_number.h" #include "rtc_base/synchronization/mutex.h" @@ -422,6 +423,7 @@ SharedScreenCastStreamPrivate::~SharedScreenCastStreamPrivate() { } } +RTC_NO_SANITIZE("cfi-icall") bool SharedScreenCastStreamPrivate::StartScreenCastStream( uint32_t stream_node_id, int fd) {