Skip to contentSkip to conversation

creat09: Run on all_filesystems

PATCH In review Petr Vorel 4 participants 5 messages Oct 15, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v4 1/1 creat09: Run on all_filesystems

To make sure bug on XFS is detected on systems which use it.

Due setgid is test problematic on Microsoft filesystems:

creat09.c:81: TBROK: ntfs: Setgid bit not set creat09.c:76: TBROK: chown(exfat,65533,4) failed: EPERM (1) creat09.c:76: TBROK: chown(vfat,65533,4) failed: EPERM (1)

thus they're disabled.

---
changes v3->v4:
* remove useless .needs_tmpdir

changes v2->v3:
* add missing dir separator /
* remove unused SAFE_CHDIR() (was needed due missing /)
* remove unused <stdio.h>

 testcases/kernel/syscalls/creat/creat09.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/creat/creat09.c +11 -2
index 681b80c7d..bed7bddb0 100644
@@ -39,7 +39,8 @@
 #define MODE_RWX        0777
 #define MODE_SGID       (S_ISGID|0777)
 
-#define WORKDIR		"testdir"
+#define MNTPOINT	"mntpoint"
+#define WORKDIR		MNTPOINT "/testdir"
 #define CREAT_FILE	WORKDIR "/creat.tmp"
 #define OPEN_FILE	WORKDIR "/open.tmp"
 
@@ -118,7 +119,15 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_root = 1,
-	.needs_tmpdir = 1,
+	.all_filesystems = 1,
+	.mount_device = 1,
+	.mntpoint = MNTPOINT,
+	.skip_filesystems = (const char*[]) {
+		"exfat",
+		"ntfs",
+		"vfat",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "0fa3ecd87848"},
 		{"CVE", "2018-13405"},
Signature · 5 lines
2.33.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v4 1/1
#1 lore raw

Hi Petr

Looks good to me,

Best Regards
Yang Xu

Quoted 54 lines

To make sure bug on XFS is detected on systems which use it.

Due setgid is test problematic on Microsoft filesystems:

creat09.c:81: TBROK: ntfs: Setgid bit not set creat09.c:76: TBROK: chown(exfat,65533,4) failed: EPERM (1) creat09.c:76: TBROK: chown(vfat,65533,4) failed: EPERM (1)

thus they're disabled.

---
changes v3->v4:
* remove useless .needs_tmpdir

changes v2->v3:
* add missing dir separator /
* remove unused SAFE_CHDIR() (was needed due missing /)
* remove unused<stdio.h>

  testcases/kernel/syscalls/creat/creat09.c | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/creat/creat09.c +11 -2
index 681b80c7d..bed7bddb0 100644
@@ -39,7 +39,8 @@
  #define MODE_RWX        0777
  #define MODE_SGID       (S_ISGID|0777)
 
-#define WORKDIR		"testdir"
+#define MNTPOINT	"mntpoint"
+#define WORKDIR		MNTPOINT "/testdir"
  #define CREAT_FILE	WORKDIR "/creat.tmp"
  #define OPEN_FILE	WORKDIR "/open.tmp"
 
@@ -118,7 +119,15 @@ static struct tst_test test = {
  	.setup = setup,
  	.cleanup = cleanup,
  	.needs_root = 1,
-	.needs_tmpdir = 1,
+	.all_filesystems = 1,
+	.mount_device = 1,
+	.mntpoint = MNTPOINT,
+	.skip_filesystems = (const char*[]) {
+		"exfat",
+		"ntfs",
+		"vfat",
+		NULL
+	},
  	.tags = (const struct tst_tag[]) {
  		{"linux-git", "0fa3ecd87848"},
  		{"CVE", "2018-13405"},
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Acked-by
#2 lore raw
Quoted 5 lines · On Fri, Oct 15, 2021 at 10:45 AM [email protected]…

Hi Petr

Looks good to me,

Quoted 57 lines

Best Regards
Yang Xu

Quoted 54 lines

To make sure bug on XFS is detected on systems which use it.

Due setgid is test problematic on Microsoft filesystems:

creat09.c:81: TBROK: ntfs: Setgid bit not set creat09.c:76: TBROK: chown(exfat,65533,4) failed: EPERM (1) creat09.c:76: TBROK: chown(vfat,65533,4) failed: EPERM (1)

thus they're disabled.

---
changes v3->v4:
* remove useless .needs_tmpdir

changes v2->v3:
* add missing dir separator /
* remove unused SAFE_CHDIR() (was needed due missing /)
* remove unused<stdio.h>

  testcases/kernel/syscalls/creat/creat09.c | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/creat/creat09.c +11 -2
index 681b80c7d..bed7bddb0 100644
@@ -39,7 +39,8 @@
  #define MODE_RWX        0777
  #define MODE_SGID       (S_ISGID|0777)
 
-#define WORKDIR              "testdir"
+#define MNTPOINT     "mntpoint"
+#define WORKDIR              MNTPOINT "/testdir"
  #define CREAT_FILE  WORKDIR "/creat.tmp"
  #define OPEN_FILE   WORKDIR "/open.tmp"
 
@@ -118,7 +119,15 @@ static struct tst_test test = {
      .setup = setup,
      .cleanup = cleanup,
      .needs_root = 1,
-     .needs_tmpdir = 1,
+     .all_filesystems = 1,
+     .mount_device = 1,
+     .mntpoint = MNTPOINT,
+     .skip_filesystems = (const char*[]) {
+             "exfat",
+             "ntfs",
+             "vfat",
+             NULL
+     },
      .tags = (const struct tst_tag[]) {
              {"linux-git", "0fa3ecd87848"},
              {"CVE", "2018-13405"},
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Hi all,

thanks you all for your reviews, merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v4 1/1
#4 lore raw
In reply to Petr Vorel

Hello,
looks good to me.

Quoted 55 lines · Petr Vorel

To make sure bug on XFS is detected on systems which use it.

Due setgid is test problematic on Microsoft filesystems:

creat09.c:81: TBROK: ntfs: Setgid bit not set creat09.c:76: TBROK: chown(exfat,65533,4) failed: EPERM (1) creat09.c:76: TBROK: chown(vfat,65533,4) failed: EPERM (1)

thus they're disabled.

---
changes v3->v4:
* remove useless .needs_tmpdir

changes v2->v3:
* add missing dir separator /
* remove unused SAFE_CHDIR() (was needed due missing /)
* remove unused <stdio.h>

 testcases/kernel/syscalls/creat/creat09.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/creat/creat09.c +11 -2
index 681b80c7d..bed7bddb0 100644
@@ -39,7 +39,8 @@
 #define MODE_RWX        0777
 #define MODE_SGID       (S_ISGID|0777)
 
-#define WORKDIR		"testdir"
+#define MNTPOINT	"mntpoint"
+#define WORKDIR		MNTPOINT "/testdir"
 #define CREAT_FILE	WORKDIR "/creat.tmp"
 #define OPEN_FILE	WORKDIR "/open.tmp"
 
@@ -118,7 +119,15 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_root = 1,
-	.needs_tmpdir = 1,
+	.all_filesystems = 1,
+	.mount_device = 1,
+	.mntpoint = MNTPOINT,
+	.skip_filesystems = (const char*[]) {
+		"exfat",
+		"ntfs",
+		"vfat",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "0fa3ecd87848"},
 		{"CVE", "2018-13405"},
Signature · 10 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp