memfd_secret: use unsigned int rather than long as syscall flags type
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 13 Apr 2021 22:21:46 +0000 (08:21 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Apr 2021 11:48:54 +0000 (21:48 +1000)
Yuri Norov says:

  If parameter size is the same for native and compat ABIs, we may
  wire a syscall made by compat client to native handler. This is
  true for unsigned int, but not true for unsigned long or pointer.

  That's why I suggest using unsigned int and so avoid creating compat
  entry point.

Use unsigned int as the type of the flags parameter in memfd_secret()
system call.

Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
tools/testing/selftests/vm/memfd_secret.c

index c878c2b841fc3c9d420e164f741c49488dff557b..2462f52e9c966867f50eb021a92f531ad99f04ad 100644 (file)
@@ -38,7 +38,7 @@ static unsigned long page_size;
 static unsigned long mlock_limit_cur;
 static unsigned long mlock_limit_max;
 
-static int memfd_secret(unsigned long flags)
+static int memfd_secret(unsigned int flags)
 {
        return syscall(__NR_memfd_secret, flags);
 }