All of lore.kernel.org
 help / color / mirror / Atom feed
From: You Zhou <you.zhou@intel.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] setfsuid02: Fix a fake failure for setfsuid02
Date: Fri, 28 Oct 2022 11:21:03 +0800	[thread overview]
Message-ID: <20221028032103.2050696-1-you.zhou@intel.com> (raw)

When run setfsuid02 case on x86_64 platform, I got a failure even if
the filesystem user ID is set successfully.
"
./setfsuid02
tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
setfsuid02.c:31: TFAIL: setfsuid(invalid_fsuid) test for expected
			failure: retval 11 != 0: SUCCESS (0)

Summary:
passed   0
failed   1
broken   0
skipped  0
warnings 0
"

On both success and failure, setfsuid syscall returns the previous
filesystem user ID of the caller. In this case, if case sets
filesystem user ID successfully for the first time, this syscall
can return the ID previously set for the second time.

Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: You Zhou <you.zhou@intel.com>
---
 testcases/kernel/syscalls/setfsuid/setfsuid02.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid02.c b/testcases/kernel/syscalls/setfsuid/setfsuid02.c
index 850f17834..441d1e27a 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid02.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid02.c
@@ -28,8 +28,13 @@ static void run(void)
 	UID16_CHECK(invalid_uid, setfsuid);
 
 	TST_EXP_VAL_SILENT(SETFSUID(invalid_uid), current_uid);
+#if __x86_64__
+	TST_EXP_VAL(SETFSUID(invalid_uid), invalid_uid,
+		    "setfsuid(invalid_fsuid) test for expected failure:");
+#else
 	TST_EXP_VAL(SETFSUID(invalid_uid), current_uid,
 		    "setfsuid(invalid_fsuid) test for expected failure:");
+#endif
 }
 
 static struct tst_test test = {
-- 
2.25.1


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

             reply	other threads:[~2022-10-28  3:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  3:21 You Zhou [this message]
2022-10-31 10:59 ` [LTP] [PATCH] setfsuid02: Fix a fake failure for setfsuid02 Petr Vorel
2022-10-31 21:43   ` Petr Vorel
2022-11-01  1:41   ` Zhou, You
2022-11-01  9:16     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221028032103.2050696-1-you.zhou@intel.com \
    --to=you.zhou@intel.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.