Kernel Security test failed to build on aarch64 with -m32 flag

Bug #1650498 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QA Regression Testing
Fix Released
Undecided
Unassigned

Bug Description

As gcc on aarch64 does not take the -m32 flag, some test case will fail

09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_020_aslr_dapper_stack (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of stack
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1745, in test_020_aslr_dapper_stack
09:34:22 ERROR| [stderr] self._test_aslr('stack', 0)
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:22 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:22 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:22 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:22 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:22 ERROR| [stderr] Command: 'make'
09:34:22 ERROR| [stderr] Output:
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -fPIC -pie -o aslr aslr.c -ldl
09:34:22 ERROR| [stderr] aslr.c: In function ‘area_pointer’:
09:34:22 ERROR| [stderr] aslr.c:145:8: warning: format ‘%p’ expects argument of type ‘void *’, but argument 3 has type ‘uintptr_t’ [-Wformat=]
09:34:22 ERROR| [stderr] area_pointer(AREA_TEXT));
09:34:22 ERROR| [stderr] ^
09:34:22 ERROR| [stderr] aslr.c:145:8: warning: format ‘%p’ expects argument of type ‘void *’, but argument 4 has type ‘uintptr_t’ [-Wformat=]
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -fPIC -pie -o mmap-growth-direction mmap-growth-direction.c
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:22 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:22 ERROR| [stderr] make: *** [aslr32] Error 1
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_021_aslr_dapper_libs (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of libs
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1776, in test_021_aslr_dapper_libs
09:34:22 ERROR| [stderr] self._test_aslr('libs', expected)
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:22 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:22 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:22 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:22 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:22 ERROR| [stderr] Command: 'make'
09:34:22 ERROR| [stderr] Output:
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:22 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:22 ERROR| [stderr] make: *** [aslr32] Error 1
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_021_aslr_dapper_mmap (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of mmap
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1761, in test_021_aslr_dapper_mmap
09:34:22 ERROR| [stderr] self._test_aslr('mmap', expected)
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:22 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:22 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:22 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:22 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:22 ERROR| [stderr] Command: 'make'
09:34:22 ERROR| [stderr] Output:
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:22 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:22 ERROR| [stderr] make: *** [aslr32] Error 1
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_022_aslr_hardy_text (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of text
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1792, in test_022_aslr_hardy_text
09:34:22 ERROR| [stderr] self._test_aslr('text', expected)
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:22 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:22 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:22 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:22 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:22 ERROR| [stderr] Command: 'make'
09:34:22 ERROR| [stderr] Output:
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:22 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:22 ERROR| [stderr] make: *** [aslr32] Error 1
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_022_aslr_hardy_vdso (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of vdso
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1807, in test_022_aslr_hardy_vdso
09:34:22 ERROR| [stderr] self._test_aslr('vdso', expected)
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:22 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:22 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:22 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:22 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:22 ERROR| [stderr] Command: 'make'
09:34:22 ERROR| [stderr] Output:
09:34:22 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:22 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:22 ERROR| [stderr] make: *** [aslr32] Error 1
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr]
09:34:22 ERROR| [stderr] ======================================================================
09:34:22 ERROR| [stderr] FAIL: test_022_aslr_intrepid_brk (__main__.KernelSecurityTest)
09:34:22 ERROR| [stderr] ASLR of brk
09:34:22 ERROR| [stderr] ----------------------------------------------------------------------
09:34:22 ERROR| [stderr] Traceback (most recent call last):
09:34:22 ERROR| [stderr] File "./test-kernel-security.py", line 1823, in test_022_aslr_intrepid_brk
09:34:22 ERROR| [stderr] self._test_aslr('brk', expected)
09:34:23 ERROR| [stderr] File "./test-kernel-security.py", line 1731, in _test_aslr
09:34:23 ERROR| [stderr] self.assertShellExitEquals(0, build)
09:34:23 ERROR| [stderr] File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1124, in assertShellExitEquals
09:34:23 ERROR| [stderr] self.assertEqual(expected, rc, msg + result + report)
09:34:23 ERROR| [stderr] AssertionError: Got exit code 2, expected 0
09:34:23 ERROR| [stderr] Command: 'make'
09:34:23 ERROR| [stderr] Output:
09:34:23 ERROR| [stderr] cc -Wall -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -m32 -fPIC -pie -o aslr32 aslr.c -ldl
09:34:23 ERROR| [stderr] cc: error: unrecognized command line option ‘-m32’
09:34:23 ERROR| [stderr] make: *** [aslr32] Error 1

Po-Hsu Lin (cypressyew)
summary: - Kerenl Security test failed to build on aarch64 with -m32 flag
+ Kernel Security test failed to build on aarch64 with -m32 flag
Revision history for this message
Steve Beattie (sbeattie) wrote :

Hi,

I've gone ahead and disabled the attempt at building 32 bit arm test binaries on aarch64. It doesn't appear there's an obvious equivalent to -m32, so it looks like cross-compiling might be necessary (multiarch doesn't seem to be enabled on arm64 by default either). Happy to be educated.

Thanks for the report.

Changed in qa-regression-testing:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.