test_095_kernel_symbols_missing_proc_self_stack failed with Xenial kernel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QA Regression Testing |
Fix Released
|
Undecided
|
Steve Beattie | ||
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Unassigned | ||
linux-lts-xenial (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This is a split from bug 1800976, to make it become more specific to a single failure.
This test will fail with the proposed Xenial kernel.
FAIL: test_095_
kernel addresses in /proc/self/stack are zeroed out
-----
Traceback (most recent call last):
File "./test-
self.
File "./test-
test_
File "./test-
expected, retry=True)
File "./test-
self.
AssertionError: cat: /proc/self/stack: Permission denied
From Khaled's comment #1 in that bug:
The commit "c714676a1 proc: restrict kernel stack dumps to root" (part of the update to linux-stable 4.4.160) has changed the permissions of /proc/self/stack to be root- and CAP_SYS_ADMIN-only which is causing test_095_
So we might need to fix this from the test case perspective.
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-139-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.29
Architecture: amd64
Date: Wed Nov 7 08:13:40 2018
SourcePackage: linux-lts-xenial
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in linux-lts-xenial (Ubuntu): | |
status: | New → Invalid |
Changed in ubuntu-kernel-tests: | |
status: | Confirmed → Fix Released |
So the issue lies within the _read_twice() in test-kernel- security. py script.
The first attempt to cat /proc/self/stack will return 0, as it's reading the file as root.
The second attempt will failed with "permission denied" as we're not allowing regular user to access that file anymore.
But the code in _read_twice() is still expecting it to return a zeroed-out content, like: 000>] save_stack_ trace_tsk+ 0x22/0x40 000>] proc_pid_ stack+0xac/ 0x100 000>] proc_single_ show+0x55/ 0x90 000>] seq_read+0xf2/0x3d0 000>] __vfs_read+ 0x1b/0x40 000>] vfs_read+0x86/0x130 000>] SyS_read+0x55/0xc0 000>] entry_SYSCALL_ 64_fastpath+ 0x22/0xc1 000>] 0xffffffffffffffff
$ cat /proc/self/stack
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
[<0000000000000
Thus for 4.4 kernel, we can expect two different behaviour, one is the zeroed-out kernel address, another is the permission denied error.