** Description changed:

- Backport 2-patch upstream series that lets modular drivers reuse the
- system-wide perf permission model, and applies it to drm/xe's observation
- interfaces.
+ [Impact]
  
- Currently both patches are in linux-next (and drm-next); targeting v7.3.
+ perf_allow_cpu() and perf_allow_tracepoint() are static inline in
+ <linux/perf_event.h> and reference sysctl_perf_event_paranoid and
+ security_perf_event_open(), neither of which is exported. Modules cannot
+ reuse the system-wide perf permission model and open-code partial copies
+ instead.
+ 
+ drm/xe does this in its OA and EU-stall observation paths, open-coding a
+ CPU-event check that ignores kernel.perf_event_paranoid and the
+ security_perf_event_open() LSM hook. On systems with Intel Xe graphics,
+ xe observation honors neither.
+ 
+ [Fix]
+ 
+ Patch 1 moves perf_allow_cpu/tracepoint() out of line into
+ kernel/events/core.c and exports them EXPORT_SYMBOL_GPL, with
+ !CONFIG_PERF_EVENTS stubs. No behavior change for existing callers.
+ Patch 2 switches xe's OA and EU-stall paths to perf_allow_cpu() so they
+ honor kernel.perf_event_paranoid and the LSM perf hook;
+ dev.xe.observation_paranoid stays as an escape hatch.
+ 
+ Upstream commits in linux-next/drm-next, targeting v7.3:
  
  d32bf877c0c3 ("perf/core: out-of-line and export perf_allow_cpu/tracepoint()")
- 6680bf0cb726 ("drm/xe: gate observation streams with perf_allow_cpu()")
+ 6680bf0cb726 ("drm/xe: gate observation streams with perf_allow_cpu()") 
  
- lore:
+ Link:
  https://lore.kernel.org/all/[email protected]/
+ 
+ drm/xe is backported: this kernel lacks commit 41255b2f1e03, so a
+ duplicate int ret declaration was dropped. perf/core is a clean cherry-
+ pick.
+ 
+ [Test Plan]
+ 
+ 
+ - Builds clean with PERF_EVENTS=y, with PERF_EVENTS=n + DRM_XE=m 
(COMPILE_TEST), and with DRM_XE=m.
+ - Boots with no dmesg regressions.
+ - perf_allow_cpu/tracepoint show as EXPORT_SYMBOL_GPL in Module.symvers and 
/proc/kallsyms (absent when unpatched).
+ - A non-root perf_event_paranoid sweep confirms perf_event_open() allow/deny 
is unchanged.
+ 
+ [Where problems could occur]
+ 
+ Patch 1 has identical behavior for existing callers. Patch 2 changes xe 
observation permissions only on Intel Xe systems; others are unaffected. 
+ Low risk.

** Also affects: linux (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160654

Title:
  Backport: export perf_allow_cpu/tracepoint() and gate drm/xe
  observation

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2160654/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to