Hi, This series fixes user_events registration from threads that already share an address space before the first user_events registration.
The first patch adds regression coverage. The second ensures that pre-existing threads sharing the same mm_struct also share the same user_event_mm instead of independently creating wrappers with separate enabler lists. With the fix, a second registration using the same enable address and bit is correctly rejected with EADDRINUSE. The series was rebased onto Linux 7.3-rc6. The complete user_events ABI selftest suite passes under virtme-ng: PASSED: 7 / 7 tests passed. Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0 Changes in v2: - Remove the unreachable second-registration cleanup assertion reported by Sashiko. ASSERT_EQ(-1, registration.second_ret) aborts on mismatch, so the subsequent if (!registration.second_ret) condition could never execute. - Remove the now-unused second_unreg_ret field while retaining cleanup when the second registration unexpectedly succeeds. - Remove the redundant first-registration cleanup guard. - Use the natural alignment of the __u32 enable word and correct continuation indentation. - Rebase onto Linux 7.3-rc6. Both patches pass scripts/checkpatch.pl --strict with 0 errors, 0 warnings, and 0 checks. Jeff Jeff Barnes (2): selftests/user_events: Test registration from existing threads tracing/user_events: Share tracing state between existing threads kernel/trace/trace_events_user.c | 78 +++++++++-- .../testing/selftests/user_events/abi_test.c | 125 ++++++++++++++++++ 2 files changed, 189 insertions(+), 14 deletions(-) -- 2.43.0
