* tests/init_delete_module.h (bogus_zero): Remove.
* tests/delete_module.c (main): Replace bogus_zero and
(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/finit_module.c (main): Replace bogus_zero
with F8ILL_KULONG_MASK.
* tests/init_module.c (main): Likewise.
* tests/pipe2.c (main): Likewise.
* tests/epoll_ctl.c (invoke_syscall): Replace
(unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise.
* tests/fanotify_init.c (main): Likewise.
* tests/xetpgid.c (main): Likewise.
* tests/xetpriority.c (main): Likewise.
(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/fanotify_mark.c (main): Likewise.
* tests/file_handle.c (main): Likewise.
* tests/kexec_load.c (main): Likewise.
* tests/setfsugid.c (main): Likewise.
* tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL
with F8ILL_KULONG_MASK.
* tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL
and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
unsigned int val_prefix, val_suffix;
} flags[] = {
{ ARG_STR(0), 0, 0 },
- { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK,
- "O_NONBLOCK", 0, 0 },
+ { F8ILL_KULONG_MASK | O_NONBLOCK, "O_NONBLOCK", 0, 0 },
{ (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC),
" /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0},
{ (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC,
fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN);
fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN);
- rc = syscall(__NR_delete_module, NULL, bogus_zero);
+ rc = syscall(__NR_delete_module, NULL, F8ILL_KULONG_MASK);
printf("delete_module(NULL, 0) = %s\n", sprintrc(rc));
rc = syscall(__NR_delete_module, bogus_param1, flags[0].val);
static long
invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev)
{
- op |= (unsigned long) 0xffffffff00000000ULL;
- return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev);
+ return syscall(__NR_epoll_ctl, epfd, F8ILL_KULONG_MASK | op,
+ fd, (unsigned long) ev);
}
int
main(void)
{
static const struct strval flags[] = {
- { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" },
+ { F8ILL_KULONG_MASK, "FAN_CLASS_NOTIF" },
{ (kernel_ulong_t) 0xffffffff0000000cULL,
"0xc /* FAN_CLASS_??? */" },
{ (kernel_ulong_t) 0xdec0deddefaced04ULL,
"FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" },
};
static const struct strval event_f_flags[] = {
- { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" },
+ { F8ILL_KULONG_MASK, "O_RDONLY" },
{ (kernel_ulong_t) 0xdeadbeef80000001ULL,
"O_WRONLY|0x80000000" }
};
static const kernel_ulong_t fds[] = {
(kernel_ulong_t) 0xdeadfeed12345678ULL,
- (kernel_ulong_t) 0xffffffff00000000ULL,
+ F8ILL_KULONG_MASK,
(kernel_ulong_t) 0xdeb0d1edffffffffULL,
};
static const struct strval flags[] = {
- { (kernel_ulong_t) 0xffffffff00000000ULL, "0" },
+ { F8ILL_KULONG_MASK, "0" },
{ (kernel_ulong_t) 0xdec0deddefaced00ULL,
"0xefaced00 /* FAN_MARK_??? */" },
{ (kernel_ulong_t) 0xda7a105700000040ULL,
(kernel_ulong_t) 0x12345678ffffff9cULL,
};
static const struct strval open_flags[] = {
- { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" },
+ { F8ILL_KULONG_MASK, "O_RDONLY" },
{ (kernel_ulong_t) 0xdeadbeef80000001ULL,
"O_WRONLY|0x80000000" }
};
fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN);
fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN);
- rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero);
+ rc = syscall(__NR_finit_module, F8ILL_KULONG_MASK, NULL,
+ F8ILL_KULONG_MASK);
printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc));
rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val);
if (ngroups < 0)
perror_msg_and_fail(SYSCALL_NAME);
- rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0);
+ rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0);
printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc);
rc = syscall(SYSCALL_NR, -1U, 0);
rc = syscall(SYSCALL_NR, ngroups_max, 0);
printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc));
- rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0);
+ rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, 0);
printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc));
/* check how the second argument is decoded */
MAX_STRLEN = 32,
};
-static const kernel_ulong_t bogus_zero =
- (kernel_ulong_t) 0xffffffff00000000ULL;
-
static void
print_str(unsigned int base, unsigned int len, bool escape)
{
fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN);
fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN);
- rc = syscall(__NR_init_module, NULL, bogus_zero, NULL);
+ rc = syscall(__NR_init_module, NULL, F8ILL_KULONG_MASK, NULL);
printf("init_module(NULL, %llu, NULL) = %s\n",
- (unsigned long long) bogus_zero, sprintrc(rc));
+ (unsigned long long) F8ILL_KULONG_MASK, sprintrc(rc));
rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1);
errstr = sprintrc(rc);
};
static const kernel_ulong_t bogus_zero =
- sizeof(long) < sizeof(kernel_long_t) ?
- (kernel_ulong_t) 0xffffffff00000000ULL : 0;
+ sizeof(long) < sizeof(kernel_long_t) ? F8ILL_KULONG_MASK : 0;
static const kernel_ulong_t bogus_entry =
(kernel_ulong_t) 0xdeadca57badda7a1ULL;
static const kernel_ulong_t bogus_nsegs =
int
main(void)
{
- static const kernel_ulong_t bogus_zero =
- (kernel_ulong_t) 0xffffffff00000000ULL;
int *const fds = tail_alloc(sizeof(*fds) * 2);
int *const efault = fds + 1;
long rc;
- rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK);
+ rc = syscall(__NR_pipe2, fds, F8ILL_KULONG_MASK | O_NONBLOCK);
if (rc)
perror_msg_and_skip("pipe2");
printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]);
- rc = syscall(__NR_pipe2, efault, bogus_zero);
+ rc = syscall(__NR_pipe2, efault, F8ILL_KULONG_MASK);
printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc));
if (F8ILL_KULONG_SUPPORTED) {
k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info)
{
return syscall(__NR_rt_tgsigqueueinfo,
- (unsigned long) 0xffffffff00000000ULL | pid,
- (unsigned long) 0xffffffff00000000ULL | pid,
- (unsigned long) 0xffffffff00000000ULL | sig,
+ F8ILL_KULONG_MASK | pid,
+ F8ILL_KULONG_MASK | pid,
+ F8ILL_KULONG_MASK | sig,
info);
}
const kernel_ulong_t tests[] = {
ugid,
0xffff0000U | ugid,
- (kernel_ulong_t) 0xffffffff00000000ULL | ugid,
+ F8ILL_KULONG_MASK | ugid,
0xffffU,
-1U,
-1L,
long rc = syscall(SYSCALL_NR, 0, 0);
printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc));
- rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0);
+ rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0);
printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc));
rc = syscall(SYSCALL_NR, 1, 0);
printuid(g3[1]);
printf(", ...]) = %s\n", errstr);
- const unsigned long size =
- (unsigned long) 0xffffffff00000000ULL | ngroups_max;
- rc = syscall(SYSCALL_NR, size, g3);
+ rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, g3);
errstr = sprintrc(rc);
printf("%s(%d, [", SYSCALL_NAME, ngroups_max);
printuid(g3[0]);
main(void)
{
const int pid = getpid();
- long rc = syscall(__NR_getpgid,
- (unsigned long) 0xffffffff00000000ULL | pid);
+ long rc = syscall(__NR_getpgid, F8ILL_KULONG_MASK | pid);
printf("getpgid(%d) = %ld\n", pid, rc);
- rc = syscall(__NR_setpgid,
- (unsigned long) 0xffffffff00000000ULL,
- (unsigned long) 0xffffffff00000000ULL | pid);
+ rc = syscall(__NR_setpgid, F8ILL_KULONG_MASK, F8ILL_KULONG_MASK | pid);
printf("setpgid(0, %d) = %ld\n", pid, rc);
puts("+++ exited with 0 +++");
{
const int pid = getpid();
long rc = syscall(__NR_getpriority, PRIO_PROCESS,
- (unsigned long) 0xffffffff00000000ULL | pid);
+ F8ILL_KULONG_MASK | pid);
printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc);
rc = syscall(__NR_setpriority, PRIO_PROCESS,
- (unsigned long) 0xffffffff00000000ULL | pid,
- (unsigned long) 0xffffffff00000000ULL);
+ F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK);
printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc));
puts("+++ exited with 0 +++");