public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Prevent inconsistent CPU state after sequence of dlclose/dlopen
@ 2025-01-10 15:55 Mathieu Desnoyers
  2025-01-10 16:47 ` Adhemerval Zanella Netto
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Mathieu Desnoyers @ 2025-01-10 15:55 UTC (permalink / raw)
  To: libc-alpha
  Cc: Florian Weimer, carlos@redhat.com, Mark Rutland, Peter Zijlstra,
	linux-kernel, x86, paulmck, Michael Jeanson

Hi,

I was discussing with Mark Rutland recently, and he pointed out that a
sequence of dlclose/dlopen mapping new code at the same addresses in
multithreaded environments is an issue on ARM, and possibly on Intel/AMD
with the newer TLB broadcast maintenance.

I maintain the membarrier(2) system call, which provides a
MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE command for this
purpose. It's been there since Linux 4.16. It can be configured
out (CONFIG_MEMBARRIER=n), but it's enabled by default.

Calling this after dlclose() in glibc would prevent this issue.

Is it handled in some other way, or should we open a bugzilla
entry to track this ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-01-15 20:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 15:55 Prevent inconsistent CPU state after sequence of dlclose/dlopen Mathieu Desnoyers
2025-01-10 16:47 ` Adhemerval Zanella Netto
2025-01-15 20:16   ` Mathieu Desnoyers
2025-01-10 16:54 ` Peter Zijlstra
2025-01-10 17:02   ` Mathieu Desnoyers
2025-01-10 17:10     ` Florian Weimer
2025-01-10 17:14       ` Adhemerval Zanella Netto
2025-01-10 17:15       ` Mathieu Desnoyers
2025-01-10 17:24         ` Adhemerval Zanella Netto
2025-01-10 17:35           ` Mathieu Desnoyers
2025-01-10 17:46         ` Florian Weimer
2025-01-10 19:16           ` Mathieu Desnoyers
2025-01-10 17:11     ` Peter Zijlstra
2025-01-10 18:41       ` Mark Rutland
2025-01-10 17:12     ` Adhemerval Zanella Netto
2025-01-10 17:04 ` Florian Weimer
2025-01-10 17:13   ` Mathieu Desnoyers
2025-01-10 18:33     ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox