[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Suppressing SIGBUS signals

Suppressing SIGBUS signals

Posted Jun 27, 2021 8:13 UTC (Sun) by randomguy3 (subscriber, #71063)
In reply to: Suppressing SIGBUS signals by randomguy3
Parent article: Suppressing SIGBUS signals

I went and looked up the link:

The reason is that there will always exist clients which are either old (and predate file sealing) or refuse to use Linux-only APIs (they don't use memfd and file sealing, instead they use e.g. shm_open). Requiring sealed memfds in compositors would break these clients.

I don't believe the situation is about to change.

Rather than requiring changes in all compositors *and* clients, can we maybe only require changes in compositors? For instance, OpenBSD has a __MAP_NOFAULT flag. When passed to mmap, it means that out-of-bound accesses will read as zeroes instead of triggering SIGBUS. Such a flag would be very helpful to unblock the annoying SIGBUS situation.


to post comments

Suppressing SIGBUS signals

Posted Jun 28, 2021 1:25 UTC (Mon) by viro (subscriber, #7872) [Link] (1 responses)

Create and open a file on tmpfs, in directory not accessible to anyone else. mmap() it. Pass the descriptor over SCM_RIGHTS datagram. And unlink() the damn thing, to keep the clutter down. Or use O_TMPFILE, for that matter, since that's no more Linux-specific than new mmap flags would be.

Sure, somebody malicious and controlling a process with your credentials will be able to screw you over, but then they could attach gdb to your client and have their merry way with it.

Suppressing SIGBUS signals

Posted Jul 2, 2021 19:28 UTC (Fri) by daniels (subscriber, #16193) [Link]

> Create and open a file on tmpfs, in directory not accessible to anyone else. mmap() it. Pass the descriptor over SCM_RIGHTS datagram. And unlink() the damn thing, to keep the clutter down.

That’s literally what we do, yeah.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds