From e3e01943d4dc6a428f337ebb7a98d271f0f14877 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Fri, 27 Apr 2018 15:33:11 -0700 Subject: [PATCH] mount regression test: convert mount test to use MS_NODEV The mount regression test passes MS_MANDLOCK to the mount(2) syscall in the test program. When the kernel is configured without CONFIG_MANDATORY_FILE_LOCKING set, attempting to mount a filesystem with this option always fails with EPERM. To fix, convert the test program to use the MS_NODEV option instead. (cherry picked from commit 49ba6af2bf49be9eff89ce760cca60f33eb8e341) Signed-off-by: Steve Beattie Acked-by: John Johansen Bug: https://bugs.launchpad.net/apparmor/+bug/1765025 PR: https://gitlab.com/apparmor/apparmor/merge_requests/109 --- tests/regression/apparmor/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression/apparmor/mount.c b/tests/regression/apparmor/mount.c index ab6e6e633..a250aa8b2 100644 --- a/tests/regression/apparmor/mount.c +++ b/tests/regression/apparmor/mount.c @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) } if (strcmp(argv[1], "mount") == 0) { - if (mount(argv[2], argv[3], "ext2", 0xc0ed0000 | MS_MANDLOCK, NULL ) == -1) { + if (mount(argv[2], argv[3], "ext2", 0xc0ed0000 | MS_NODEV, NULL ) == -1) { fprintf(stderr, "FAIL: mount %s on %s failed - %s\n", argv[2], argv[3], strerror(errno));