Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 25 May 2023 18:53:19 +0200
From: Markus Wichmann <>
Subject: vm lock needed in mprotect?

Hi all,

I'm wondering if the vm lock is needed in mprotect(), similar to
munmap(). Reason for the vm lock was that if an application had two
threads waiting on a process-shared barrier, and one thread came out of
it to immediately unmap the SHM segment, then the other thread might not
yet have had a change to exit pthread_barrier_wait(), and since that
function accesses the barrier object after the last futex wait call, it
would crash.

So what if that first thread, instead of unmapping the SHM, just changes
its protection to read-only? That would also crash. Or is that somehow
not valid? If so, why?


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.