Closed gyakovlev closed 3 years ago
This is a known-issue caused by modern distros using a newer systemd vresion that mounts devtmpfs as noexec in /dev..
There was some discussions in fixing this by copying the hbrt image to a standard memory location, and then executing it from there, instead of trying to execute directly from it's location on the reserved memory range, but no one came around to implement it yet (patches welcome!)
For now, the workaround is to remount the /dev filesystem without noexec, and re-start the opal-prd daemon.
-Klaus
I tried mounting /sys
without noexec
, but it was ~/proc
~ /dev
, makes sense now, thanks for explanation!
I can try making an attempt at writing a patch as time permits, but my C is rather weak, so no promises.
edited for clarity
That's odd - it should have been devtmpfs mounted at /dev with noexec preventing opal-prd to run.
you are right, my brain meant /dev
but fingers typed /proc
for some reason.
this line in fstab devtmpfs /dev devtmpfs nosuid,mode=755 0 0
works around the problem for now, but I'll still make an attempt at a patch as I have time later this week.
I think @hegdevasant was looking at fixing this, but you're also welcome to try. We figured allocating some memory with an anonymous mmap()
that's initially mapped R+W, copying the HBRT image into there then using mprotect()
to remap it as R+X would do the trick.
I've sent patch to skiboot list for review, it was easier than I imagined, thanks for guide how to do it.
works now on my system with /dev
mounted with noexec
.
Hi, on Raptor Talos II I used to run opal-prd just fine, but recently re-installed the system and now can't launch opal-prd.
opal-prd
compiled from6.6.3
tag.error happens in
map_hbrt_physmem
https://github.com/open-power/skiboot/blob/f901fcafae14d38e29f1cc11440086ee678785d0/external/opal-prd/opal-prd.c#L984-L991
Any ideas why mmap returns
EPERM
here?full debug output
here's the reg hexdump, numbers seem to match.
and full strace, just in case. opal-prd-stace.txt
Thanks in advance.