]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
sanity.bbclass: raise_sanity_error if /tmp is noexec
authorMichal Sieron <michalwsieron@gmail.com>
Mon, 12 Feb 2024 09:09:26 +0000 (10:09 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Feb 2024 13:51:38 +0000 (13:51 +0000)
Older meson versions save temporary scripts in /tmp.
Similarly some recipies also do that (e.g. ccan in sbsigntool).

As this can lead to unexpected build failures with no simple way
to workaround, make such setup a fatal error.

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
meta/classes-global/sanity.bbclass

index 1bd74e1935a4639d7b89914ed9a593b935bc52ff..bbbc41ddae959ee3669cdcc2de5bcea9b5cbc2bc 100644 (file)
@@ -840,6 +840,10 @@ def check_sanity_everybuild(status, d):
         status.addresult("Please use a umask which allows a+rx and u+rwx\n")
     os.umask(omask)
 
+    # Ensure /tmp is NOT mounted with noexec
+    if os.statvfs("/tmp").f_flag & os.ST_NOEXEC:
+        raise_sanity_error("/tmp shouldn't be mounted with noexec.", d)
+
     if d.getVar('TARGET_ARCH') == "arm":
         # This path is no longer user-readable in modern (very recent) Linux
         try: