Comment 2 for bug 1983357

Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Re: test_021_aslr_dapper_libs from ubuntu_qrt_kernel_security failed on K-5.19 AMD64

This test is trying to call a compiled binary "aslr32" and execute:
./aslr32 libs --verbose

If you try to call it from the script, it will fail, however if you run the binary directly it will be good:

ubuntu@harpo:~/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts$ sudo python2 ./test-kernel-security.py -v KernelSecurityTest.test_021_aslr_dapper_libs
Running test: './test-kernel-security.py' distro: 'Ubuntu 22.10' kernel: '5.19.0-15.15 (Ubuntu 5.19.0-15.15-generic 5.19.0)' arch: 'amd64' uid: 0/0 SUDO_USER: 'ubuntu')
test_021_aslr_dapper_libs (__main__.KernelSecurityTest)
ASLR of libs ... (default libs native) (default libs native rekey) (default libs COMPAT) FAIL

======================================================================
FAIL: test_021_aslr_dapper_libs (__main__.KernelSecurityTest)
ASLR of libs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test-kernel-security.py", line 1782, in test_021_aslr_dapper_libs
    self._test_aslr('libs', expected)
  File "./test-kernel-security.py", line 1739, in _test_aslr
    self._test_aslr_all(area, expected, "default %s" % area)
  File "./test-kernel-security.py", line 1732, in _test_aslr_all
    self._test_aslr_exec(area, expected, target, name)
  File "./test-kernel-security.py", line 1715, in _test_aslr_exec
    self.assertShellExitEquals(aslr_expected, ["./%s" % (target), area, "--verbose"], msg="%s:\n" % name)
  File "/home/ubuntu/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts/testlib.py", line 1203, in assertShellExitEquals
    self.assertEqual(expected, rc, msg + result + report)
AssertionError: default libs COMPAT:
Got exit code 1, expected 0
Command: './aslr32', 'libs', '--verbose'
Output:
Checking ASLR of libs:
 0xf7c81790
 0xf7c81790
 0xf7c81790
FAIL: ASLR not functional (libs always at 0xf7c81790)

----------------------------------------------------------------------
Ran 1 test in 0.589s

FAILED (failures=1)
ubuntu@harpo:~/autotest/client/tmp/ubuntu_qrt_kernel_security/src/qa-regression-testing/scripts$ sudo ./kernel-security/aslr/aslr libs --verbose
Checking ASLR of libs:
 0x007fb495c907c0
 0x007f674ea907c0
 0x007f0e0fe907c0
ok: ASLR of libs functional