test_032_dev_kmem from ubuntu_qrt_kernel_security failed on Oracular (Permission denied)
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| QA Regression Testing |
New
|
Undecided
|
Unassigned | ||
| ubuntu-kernel-tests |
New
|
Undecided
|
Unassigned | ||
Bug Description
Issue found on Openstack amd64/arm64/ppc64el with Oracular since 6.11.0-5.5 in d2024.08.12.
It's worthy to note that with 6.11.0-4.4, only ARM64 has failed with this test, AMD64 and PPC64EL are good.
The test is expecting return code 6 (No such device), but we got 13 (Permission denied) here on Oracular.
Test log:
Running 'python3 ./test-
Running test: './test-
test_032_dev_kmem (__main_
/dev/kmem not available ... FAIL
======
FAIL: test_032_dev_kmem (__main_
/dev/kmem not available
------
Traceback (most recent call last):
File "/home/
self.
File "/home/
self.
AssertionError: 6 != 13 : Got exit code 13, expected 6
Command: './errno-read.py', '/tmp/kmem-
Output:
/tmp/kmem-
------
Ran 1 test in 0.046s
FAILED (failures=1)
Related branches
- Alex Murray (community): Approve
-
Diff: 17 lines (+2/-2)1 file modifiedscripts/test-kernel-security.py (+2/-2)
- Mark Esler (community): Approve
-
Diff: 13 lines (+1/-1)1 file modifiedscripts/test-kernel-security.py (+1/-1)
| description: | updated |
Oracular ships systemd 256 and /tmp/ is now by default a tmpfs. [1]
On Oracular: nodev,size= 6123876k, nr_inodes= 1048576, inode64 discard, errors= remount- ro,commit= 30
$ findmnt --target /tmp/
TARGET SOURCE FSTYPE OPTIONS
/tmp tmpfs tmpfs rw,nosuid,
On Noble:
$ findmnt --target /tmp
TARGET
SOURCE FSTYPE OPTIONS
/ /dev/vda1 ext4 rw,relatime,
test_032_dev_kmem runs mknod(2) to create a character device file under /tmp.
Because of the difference, on Oracular, openat(2) (by errno-read.py) returns earlier with errno 13 (Permission denied), while errno 6 (No such device) is expected.
-> vfs_open()
[...]
-> may_open()
-> may_open_dev() returns 0 because of MNT_NODEV
return -EACCES
The whole point of test_032_dev_kmem is I think to test ubuntu policy (CONFIG_DEVKMEM=n for many years before bbcd53c96071 ("drivers/char: remove /dev/kmem for good")):
-> vfs_open()
[...]
-> chrdev_open()
-> memory_open()
-> devlist[2 /*kmem*/] is empty so return -ENXIO
I'll propose an update (fix) for test_032_dev_kmem to qa-regression- testing.
[1] https:/ /git.launchpad. net/ubuntu/ +source/ systemd/ tree/debian/ NEWS?h= ce0abd32d7d3a& id=ce0abd32d7d3 a920a7728a21a19 77749db2e3776