[LTP] [PATCH v5 3/6] Disable kernel version check in landlock tests

Petr Vorel pvorel@suse.cz
Mon Aug 12 21:15:23 CEST 2024


Hi all,

> Hi Meckael,

> On 8/9/24 16:36, Mickaël Salaün wrote:
> > On Thu, Aug 08, 2024 at 11:58:24AM +0200, Petr Vorel wrote:
> > > is is really helpful when landlock support has
> > > > been backported into old kernels.
> > > Great, I'm glad you removed it from all landlock tests. It really did not make
> > > sense to guard correct version with 3 guards (kernel version, kernel config and
> > > ABI). Could you please remove also CONFIG_SECURITY_LANDLOCK=y, because you
> > > check EOPNOTSUPP in verify_landlock_is_enabled().

> > > Anyway, feel free to merge these first 3 patches (ideally remove also
> > > CONFIG_SECURITY_LANDLOCK=y before merge).
> > My understanding is that LTP only tests supported features to make sure
> > they work as expected, if enabled.  Is it correct?
> Yes, landlock in particular can be a backported feature, so we need to
> remove CONFIG flags and kernel version, raising an error just in case we
> have ENOSYS.
> > I'm then wondering what is the purpose of needs_kconfigs.  If there is
> > no "needed" config, does that means that Landlock tests will always run
> > and detect at run time if tests are skipped or not?  If yes, it looks
> > good to me.

> > Andrea's commit to remove needs_kconfig:
> > https://github.com/linux-test-project/ltp/commit/e7ebc637d0d99295490adf57660a3b3a177d65d3

> > Is there an online dashboard to see some tested kernels?
> @Petr Vorel

I suppose folks at Linaro, Nikolai (CKI) or other companies which do public
testing have some public logs.

We have openSUSE tests on 6.10.3-1 for various archs on [1] and [2]. Here is
x86_64 [3][4] and riscv64 [5] failing on landlock06.c:38: TFAIL: ioctl(dev_fd,
FIOASYNC, &flag) failed: ENOTTY (25).

# landlock06; echo "### TEST landlock06 COMPLETE >>> $?."
tst_buffers.c:57: TINFO: Test is using guarded buffers
tst_tmpdir.c:316: TINFO: Using /var/tmp/LTP_lan8lXtC5 as tmpdir (btrfs filesystem)
tst_device.c:96: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1807: TINFO: LTP version: 20240524
tst_test.c:1651: TINFO: Timeout per run is 0h 00m 30s
tst_supported_fs_types.c:97: TINFO: Kernel supports ext2
tst_supported_fs_types.c:62: TINFO: mkfs.ext2 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext3
tst_supported_fs_types.c:62: TINFO: mkfs.ext3 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports xfs
tst_supported_fs_types.c:62: TINFO: mkfs.xfs does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports btrfs
tst_supported_fs_types.c:62: TINFO: mkfs.btrfs does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports bcachefs
tst_supported_fs_types.c:62: TINFO: mkfs.bcachefs does exist
tst_supported_fs_types.c:169: TINFO: Skipping vfat as requested by the test
tst_supported_fs_types.c:97: TINFO: Kernel supports exfat
tst_supported_fs_types.c:62: TINFO: mkfs.exfat does exist
tst_supported_fs_types.c:132: TINFO: FUSE does support ntfs
tst_supported_fs_types.c:62: TINFO: mkfs.ntfs does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports tmpfs
tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
tst_test.c:1747: TINFO: === Testing on ext2 ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=ext2 flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on ext3 ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with ext3 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=ext3 flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on ext4 ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=ext4 flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on xfs ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=xfs flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on btrfs ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=btrfs flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on bcachefs ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with bcachefs opts='' extra opts=''
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=bcachefs flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on exfat ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=exfat flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on ntfs ===
tst_test.c:1111: TINFO: Formatting /dev/loop0 with ntfs opts='' extra opts=''
The partition start sector was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of sectors per track was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of heads was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
To boot from a device, Windows needs the 'partition start sector', the 'sectors per track' and the 'number of heads' to be set.
Windows will not be able to boot from this device.
tst_test.c:1123: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=ntfs flags=0
tst_test.c:1123: TINFO: Trying FUSE...
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)
tst_test.c:1747: TINFO: === Testing on tmpfs ===
tst_test.c:1111: TINFO: Skipping mkfs for TMPFS filesystem
tst_test.c:1087: TINFO: Limiting tmpfs size to 32MB
tst_test.c:1123: TINFO: Mounting ltp-tmpfs to /var/tmp/LTP_lan8lXtC5/sandbox fstyp=tmpfs flags=0
landlock_common.h:31: TINFO: Landlock ABI v5
landlock06.c:55: TINFO: Applying LANDLOCK_ACCESS_FS_IOCTL_DEV
landlock06.c:34: TPASS: ioctl(file_fd, FIONREAD, &sz) passed
landlock06.c:35: TPASS: ioctl(dev_fd, FIOCLEX) passed
landlock06.c:36: TPASS: ioctl(dev_fd, FIONCLEX) passed
landlock06.c:37: TPASS: ioctl(dev_fd, FIONBIO, &flag) passed
landlock06.c:38: TFAIL: ioctl(dev_fd, FIOASYNC, &flag) failed: ENOTTY (25)

Summary:
passed   36
failed   9
broken   0
skipped  0
warnings 0
### TEST landlock06 COMPLETE >>> 1.

dmesg [6]:

OpenQA::run_ltp.pm: Starting landlock06
[ 1050.979179][T110531] loop0: detected capacity change from 0 to 614400
[ 1050.998116][T110531] /dev/zero: Can't lookup blockdev
[ 1051.004764][T110531] /dev/zero: Can't lookup blockdev
[ 1051.010525][T110531] /dev/zero: Can't lookup blockdev
[ 1051.014325][T110531] /dev/zero: Can't lookup blockdev
[ 1051.021487][T110531] bcachefs (/dev/zero): error reading superblock: error opening /dev/zero: ENOTBLK
[ 1051.022857][T110531] bcachefs: bch2_mount() error: ENOTBLK
[ 1051.058671][T110531] /dev/zero: Can't lookup blockdev
[ 1051.105329][T110531] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
[ 1051.117949][T110531] EXT4-fs (loop0): mounted filesystem 2c8afdbf-6fa5-42e8-8fd4-28954bdde347 r/w without journal. Quota mode: none.
[ 1051.127872][T110531] EXT4-fs (loop0): unmounting filesystem 2c8afdbf-6fa5-42e8-8fd4-28954bdde347.
[ 1051.204843][T110531] EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem
[ 1051.213928][T110531] EXT4-fs (loop0): mounted filesystem d61f27f7-7dce-4f66-ad8e-70b4a33b9222 r/w with ordered data mode. Quota mode: none.
[ 1051.218709][T110531] EXT4-fs (loop0): unmounting filesystem d61f27f7-7dce-4f66-ad8e-70b4a33b9222.
[ 1051.251190][T110531] EXT4-fs (loop0): mounted filesystem b3d3c34a-d06b-4950-9317-facae9d51858 r/w with ordered data mode. Quota mode: none.
[ 1051.255995][T110531] EXT4-fs (loop0): unmounting filesystem b3d3c34a-d06b-4950-9317-facae9d51858.
[ 1051.287117][T110531] XFS (loop0): Mounting V5 Filesystem 8b3dafa3-3d09-42ad-974f-a4f6b64dbc21
[ 1051.292956][T110531] XFS (loop0): Ending clean mount
[ 1051.299264][T110531] XFS (loop0): Unmounting Filesystem 8b3dafa3-3d09-42ad-974f-a4f6b64dbc21
[ 1051.349548][T110531] BTRFS: device fsid 773dda9f-d706-4408-9de1-6cbf1aeb810c devid 1 transid 8 /dev/loop0 (7:0) scanned by landlock06 (110531)
[ 1051.356250][T110531] BTRFS info (device loop0): first mount of filesystem 773dda9f-d706-4408-9de1-6cbf1aeb810c
[ 1051.360300][T110531] BTRFS info (device loop0): using crc32c (crc32c-intel) checksum algorithm
[ 1051.361782][T110531] BTRFS info (device loop0): using free-space-tree
[ 1051.399193][T110531] BTRFS info (device loop0): checking UUID tree
[ 1051.403606][T110531] BTRFS info (device loop0): last unmount of filesystem 773dda9f-d706-4408-9de1-6cbf1aeb810c
[ 1051.470051][T110531] bcachefs (loop0): mounting version 1.7: mi_btree_bitmap
[ 1051.472754][T110531] bcachefs (loop0): initializing new filesystem
[ 1051.474263][T110531] bcachefs (loop0): going read-write
[ 1051.475613][T110531] bcachefs (loop0): initializing freespace
[ 1051.511331][T110531] bcachefs (loop0): shutdown complete, journal seq 7

They are not failing on aarch64 [7] and ppc64le [8].

We have 6.11.0-rc2 build, which also fails on x86_64 for the same reason [9].
There is also unique bcachefs related failure (which is probably not related to
landlock):

tst_cmd.c:113: TBROK: failed to exec cmd 'mkfs.bcachefs' at tst_cmd.c:113

(also landlock04 and landlock05 fails with it).

Kind regards,
Petr

[1] https://openqa.opensuse.org/group_overview/32
[2] https://openqa.opensuse.org/group_overview/125
[3] https://openqa.opensuse.org/tests/4397937#step/landlock06/6
[4] https://openqa.opensuse.org/tests/4397937/file/serial_terminal.txt
[5] https://openqa.opensuse.org/tests/4398174#step/landlock06/6
[6] https://openqa.opensuse.org/tests/4397937/file/serial0.txt
[7] https://openqa.opensuse.org/tests/4397935#step/landlock06/8
[8] https://openqa.opensuse.org/tests/4397936#step/landlock06/8
[9] https://openqa.opensuse.org/tests/4394746#step/landlock06/8

> > > Reviewed-by: Petr Vorel <pvorel@suse.cz>

> > > Kind regards,
> > > Petr

> > > -- 
> > > Mailing list info: https://lists.linux.it/listinfo/ltp
> Regards,
> Andrea


More information about the ltp mailing list