]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
detect Linux/X32 systems
authorDamien Miller <djm@mindrot.org>
Fri, 17 Jul 2020 03:15:50 +0000 (13:15 +1000)
committerDamien Miller <djm@mindrot.org>
Fri, 17 Jul 2020 03:21:56 +0000 (13:21 +1000)
This is a frankenstein monster of AMD64 instructions/calling conventions
but with a 4GB address space. Allegedly deprecated but people still run
into it causing weird sandbox failures, e.g. bz#3085

configure.ac

index c03db273240fc51aeef334bb1203cc2a86f1a555..ff741735410797d6604c1094da50db79a0366c05 100644 (file)
@@ -522,6 +522,8 @@ SPP_MSG="no"
 # the --with-solaris-privs option and --with-sandbox=solaris).
 SOLARIS_PRIVS="no"
 
+AC_CHECK_SIZEOF([size_t])
+
 # Check for some target-specific stuff
 case "$host" in
 *-*-aix*)
@@ -864,6 +866,10 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
        case "$host" in
        x86_64-*)
                seccomp_audit_arch=AUDIT_ARCH_X86_64
+               # X32: AMD64 instructions in 32bit address space.
+               if test "x$ac_cv_sizeof_size_t" = "x4" ; then
+                       seccomp_audit_arch=AUDIT_ARCH_I386
+               fi
                ;;
        i*86-*)
                seccomp_audit_arch=AUDIT_ARCH_I386