tests: fill higher bits of integer arguments of fcntl* syscalls

Check that integer arguments of fcntl and fcntl64 syscalls are decoded
properly by casting them to kernel_ulong_t and filling higher bits.

* tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd"
syscall arguments to kernel_ulong_t, fill their higher 32 bits.
This commit is contained in:
Дмитрий Левин 2017-02-16 12:51:00 +00:00
parent ec75764697
commit 1d5e810ce8

View File

@ -44,9 +44,10 @@
static long
invoke_test_syscall(const unsigned int cmd, void *const p)
{
const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd;
const kernel_ulong_t fd = F8ILL_KULONG_MASK;
const kernel_ulong_t op = F8ILL_KULONG_MASK | cmd;
return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p);
return syscall(TEST_SYSCALL_NR, fd, op, (unsigned long) p);
}
static void