public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* BTI interaction between seccomp filters in systemd and glibc mprotect calls, causing service failures
@ 2020-10-22  3:44 Jeremy Linton
  2020-10-22  7:18 ` [systemd-devel] " Lennart Poettering
                   ` (2 more replies)
  0 siblings, 3 replies; 40+ messages in thread
From: Jeremy Linton @ 2020-10-22  3:44 UTC (permalink / raw)
  To: linux-arm-kernel, libc-alpha, systemd-devel, linux-kernel
  Cc: Szabolcs Nagy, Mark Rutland, Mark Brown, Dave Martin, Kees Cook,
	toiwoton, Catalin Marinas, Will Deacon

Hi,

There is a problem with glibc+systemd on BTI enabled systems. Systemd
has a service flag "MemoryDenyWriteExecute" which uses seccomp to deny
PROT_EXEC changes. Glibc enables BTI only on segments which are marked 
as being BTI compatible by calling mprotect PROT_EXEC|PROT_BTI. That 
call is caught by the seccomp filter, resulting in service failures.

So, at the moment one has to pick either denying PROT_EXEC changes, or 
BTI. This is obviously not desirable.

Various changes have been suggested, replacing the mprotect with mmap 
calls having PROT_BTI set on the original mapping, re-mmapping the 
segments, implying PROT_EXEC on mprotect PROT_BTI calls when VM_EXEC is 
already set, and various modification to seccomp to allow particular 
mprotect cases to bypass the filters. In each case there seems to be an 
undesirable attribute to the solution.

So, whats the best solution?


Thanks everyone,


PS: There is a fedora bug about this here: 
https://bugzilla.redhat.com/show_bug.cgi?id=1888842 which is also 
tracking a systemd issue of the same subject.

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

end of thread, other threads:[~2020-11-04 12:19 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  3:44 BTI interaction between seccomp filters in systemd and glibc mprotect calls, causing service failures Jeremy Linton
2020-10-22  7:18 ` [systemd-devel] " Lennart Poettering
2020-10-22  7:54   ` Florian Weimer
2020-10-22  8:17     ` Topi Miettinen
2020-10-22  8:25       ` Florian Weimer
2020-10-22  8:29       ` Szabolcs Nagy
2020-10-22  8:38         ` Lennart Poettering
2020-10-22  9:31           ` Catalin Marinas
2020-10-22 10:12             ` Topi Miettinen
2020-10-22 10:27               ` Florian Weimer
2020-10-23  6:13             ` Szabolcs Nagy
2020-10-23  9:04               ` Catalin Marinas
2020-10-22 10:03         ` Topi Miettinen
2020-10-22  8:05   ` Szabolcs Nagy
2020-10-22  8:31     ` Lennart Poettering
2020-10-22  7:54 ` Szabolcs Nagy
2020-10-22 10:39   ` Topi Miettinen
2020-10-22 20:02     ` Kees Cook
2020-10-22 22:24       ` Topi Miettinen
2020-10-23 17:52         ` Salvatore Mesoraca
2020-10-24 11:34           ` Topi Miettinen
2020-10-24 14:12             ` Salvatore Mesoraca
2020-10-25 13:42               ` Jordan Glover
2020-10-23  9:02       ` Catalin Marinas
2020-10-24 11:01         ` Topi Miettinen
2020-10-26 14:52           ` Catalin Marinas
2020-10-26 15:56             ` Dave Martin
2020-10-26 16:51               ` Mark Brown
2020-10-26 16:31             ` Topi Miettinen
2020-10-26 16:24 ` Dave Martin
2020-10-26 16:39   ` Topi Miettinen
2020-10-26 16:45   ` Florian Weimer
2020-10-27 14:22     ` Dave Martin
2020-10-27 14:41       ` Florian Weimer
2020-10-26 16:57   ` Szabolcs Nagy
2020-10-26 17:52     ` Dave Martin
2020-10-26 22:39       ` Jeremy Linton
2020-10-27 14:15         ` Dave Martin
2020-10-29 11:02           ` Catalin Marinas
2020-11-04 12:18             ` Dave Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).