Test failure: cannot run dumped images on OpenBSD 6.0

Bug #1621919 reported by pipping on 2016-09-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ASDF
Undecided
pipping

Bug Description

OpenBSD 6.0 made W^X the default for all partitions except the one containing /usr/local, see also

  https://www.openbsd.org/60.html

and

  https://marc.info/?l=openbsd-ports&m=147060153102724

Consequently, anything that violates W^X can still be run if it resides in /usr/local but not generally from other partitions. In particular, this affects sbcl executables dumped and run as a part of test-program, whenever the partition we're dumping to has W^X enabled (which will pretty much always be the case starting with OpenBSD 6.0). This issue cannot be worked around by dumping and running in /tmp or any such thing.

If we can reliably detect OpenBSD >= 6.0 as the host system, the test can be disabled there.

pipping (pipping) on 2016-09-09
description: updated
Faré (fahree) wrote :

NB: Only someone who uses OpenBSD can write and test a patch, so that'll be you.

For extra credits, can you check whether you're being compiled in /usr/local and/or whether your directory has W^X restrictions?

pipping (pipping) wrote :

Right, I did not expect anyone other than myself to come up with a patch but mostly meant to make this issue public and known (that is, findable through everyone's favourite search engine).

This issue affects SBCL.
It may or may not affect Clisp. Clisp on OpenBSD is so old that it has other open bugs that lead to test failures.
This issue does not affect ECL (which passes all tests).

The best way I've found so far to determine mount options is through this script:

<<<SNIP
#!/bin/sh

disk=$(df -P $1 | awk 'NR == 2 { print $1 }');
mount_options=$(mount | awk -v disk=$disk '$1 == disk { print }' | awk -F '[()]' '{print $(NF-1)}')

echo ${mount_options}
<<<SNAP

which works as follows:
# ./mount_options.sh .
local
# ./mount_options.sh /usr/local/
local, nodev, wxallowed
#

`uname -r` gives us the version info we need:
# uname -r
6.0

SBCL fortunately has :openbsd in *features* that we can test with (clisp wouldn't).

Faré (fahree) wrote :

I recommend Lisp scripting with run-program rather than invoking a shell then processing with awk.

Faré (fahree) wrote :

I hadn't realized you already had a fix. Merged.

https://gitlab.common-lisp.net/asdf/asdf/merge_requests/9

Changed in asdf:
assignee: nobody → pipping (pipping)
status: New → Fix Committed
pipping (pipping) on 2017-01-13
Changed in asdf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers