Hi,

This was an interesting little bug to invstigate. Here's what was
happening. The test checks to see that when kptr_restrict == 1, the sock
addresses reported in /proc/net/tcp are all zero for non-root users. It
then sets kptr_restrict == 0 and attempts to verify that real pointers
are reported to root and non-root users. However, recently the kernel
started to hash these pointers instead, returning the hash value in it's
place, *and* (the source of this bug) if insufficient entropy had been
collected by the kernel up to this point, making the hash "weak", the
values "(ptrval)" and "(____ptrval____)" would be returned instead. The
QRT script assumed that whatever it read would at least be a hex number
of some kind captured in a string and attempt to convert it to an int.

The insufficient entropy bit is why you would only see this failure on
the first run of the test.

This has been addressed in qrt commit https://git.launchpad.net/qa-
regression-testing/commit/?id=46f217b3f9aa0e53bb18bd2049f934199870ed1c .

Reference on the source of the values and insufficient entropy:
https://www.kernel.org/doc/Documentation/core-api/printk-formats.rst
(section on Plain Pointers)

** Changed in: qa-regression-testing
       Status: New => Fix Released

** Changed in: linux-kvm (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-kvm in Ubuntu.
https://bugs.launchpad.net/bugs/1831873

Title:
  test_095_kernel_symbols_missing_proc_net_tcp from
  ubuntu_qrt_kernel_security failed on B/C KVM

Status in QA Regression Testing:
  Fix Released
Status in ubuntu-kernel-tests:
  New
Status in linux-kvm package in Ubuntu:
  Invalid

Bug description:
  This issue can only be reproduced on the first run. The second run it
  will pass.

    ERROR: test_095_kernel_symbols_missing_proc_net_tcp 
(__main__.KernelSecurityTest)
    kernel addresses in /proc/net/tcp are zeroed out
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "./test-kernel-security.py", line 1392, in 
test_095_kernel_symbols_missing_proc_net_tcp
        self._check_pK_files(self. _095_kernel_symbols_missing_proc_net_tcp)
      File "./test-kernel-security.py", line 1235, in _check_pK_files
        test_function(expected_unrestricted)
      File "./test-kernel-security.py", line 1350, in 
_095_kernel_symbols_missing_proc_net_tcp
        expected)
      File "./test-kernel-security.py", line 1153, in _read_twice
        self.assertFalse(0 == int(address, 16), "%s: root saw %s - 
contents:\n%s" % (filename, address, root))
    ValueError: invalid literal for int() with base 16: '(ptrval)'

  ProblemType: Bug
  DistroRelease: Ubuntu 18.10
  Package: linux-image-4.18.0-1013-kvm 4.18.0-1013.13
  ProcVersionSignature: User Name 4.18.0-1013.13-kvm 4.18.20
  Uname: Linux 4.18.0-1013-kvm x86_64
  ApportVersion: 2.20.10-0ubuntu13.3
  Architecture: amd64
  Date: Thu Jun  6 09:25:10 2019
  SourcePackage: linux-kvm
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/qa-regression-testing/+bug/1831873/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to