public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Ping Fang <pifang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] setfsuid02_16: Fix uid -1 too large for testing 16-bit version
Date: Thu,  9 Mar 2023 16:54:54 +0800	[thread overview]
Message-ID: <20230309085454.735531-1-pifang@redhat.com> (raw)

__kernel_old_uid_t is not defined as 16bit on s390, ppc64le
Then -1 will be translated into UINT_MAX fails the size check.
s390, ppc64le use definition in /usr/include/asm-generic/posix_types.h

typedef unsigned int    __kernel_uid_t;
...
typedef __kernel_uid_t  __kernel_old_uid_t;

x86_64, aarch64 use definition in /usr/include/asm/posix_types_64.h
typedef unsigned short __kernel_old_uid_t;

Signed-off-by: Ping Fang <pifang@redhat.com>
---
 testcases/kernel/syscalls/utils/compat_uid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/utils/compat_uid.h b/testcases/kernel/syscalls/utils/compat_uid.h
index 94e54f310..7a345a654 100644
--- a/testcases/kernel/syscalls/utils/compat_uid.h
+++ b/testcases/kernel/syscalls/utils/compat_uid.h
@@ -26,7 +26,7 @@
 #include "tst_common.h"
 
 #ifdef TST_USE_COMPAT16_SYSCALL
-typedef __kernel_old_uid_t UID_T;
+typedef unsigned short UID_T;
 int UID_SIZE_CHECK(uid_t uid)
 {
 	/* See high2lowuid in linux/highuid.h
-- 
2.31.1


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

             reply	other threads:[~2023-03-09  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  8:54 Ping Fang [this message]
2023-03-13  9:00 ` [LTP] [PATCH v1] setfsuid02_16: Fix uid -1 too large for testing 16-bit version Li Wang
2023-03-13 22:24 ` Petr Vorel
2023-03-14  1:43   ` Ping Fang
2023-03-14 10:38     ` 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=20230309085454.735531-1-pifang@redhat.com \
    --to=pifang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox