@@ -3167,7 +3167,7 @@ TEST(get_metadata)
3167
3167
ASSERT_EQ (0 , kill (pid , SIGKILL ));
3168
3168
}
3169
3169
3170
- static int user_trap_syscall (int nr , unsigned int flags )
3170
+ static int user_notif_syscall (int nr , unsigned int flags )
3171
3171
{
3172
3172
struct sock_filter filter [] = {
3173
3173
BPF_STMT (BPF_LD + BPF_W + BPF_ABS ,
@@ -3213,7 +3213,7 @@ TEST(user_notification_basic)
3213
3213
3214
3214
/* Check that we get -ENOSYS with no listener attached */
3215
3215
if (pid == 0 ) {
3216
- if (user_trap_syscall (__NR_getppid , 0 ) < 0 )
3216
+ if (user_notif_syscall (__NR_getppid , 0 ) < 0 )
3217
3217
exit (1 );
3218
3218
ret = syscall (__NR_getppid );
3219
3219
exit (ret >= 0 || errno != ENOSYS );
@@ -3230,13 +3230,13 @@ TEST(user_notification_basic)
3230
3230
EXPECT_EQ (seccomp (SECCOMP_SET_MODE_FILTER , 0 , & prog ), 0 );
3231
3231
3232
3232
/* Check that the basic notification machinery works */
3233
- listener = user_trap_syscall (__NR_getppid ,
3234
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3233
+ listener = user_notif_syscall (__NR_getppid ,
3234
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3235
3235
ASSERT_GE (listener , 0 );
3236
3236
3237
3237
/* Installing a second listener in the chain should EBUSY */
3238
- EXPECT_EQ (user_trap_syscall (__NR_getppid ,
3239
- SECCOMP_FILTER_FLAG_NEW_LISTENER ),
3238
+ EXPECT_EQ (user_notif_syscall (__NR_getppid ,
3239
+ SECCOMP_FILTER_FLAG_NEW_LISTENER ),
3240
3240
-1 );
3241
3241
EXPECT_EQ (errno , EBUSY );
3242
3242
@@ -3305,12 +3305,12 @@ TEST(user_notification_with_tsync)
3305
3305
/* these were exclusive */
3306
3306
flags = SECCOMP_FILTER_FLAG_NEW_LISTENER |
3307
3307
SECCOMP_FILTER_FLAG_TSYNC ;
3308
- ASSERT_EQ (-1 , user_trap_syscall (__NR_getppid , flags ));
3308
+ ASSERT_EQ (-1 , user_notif_syscall (__NR_getppid , flags ));
3309
3309
ASSERT_EQ (EINVAL , errno );
3310
3310
3311
3311
/* but now they're not */
3312
3312
flags |= SECCOMP_FILTER_FLAG_TSYNC_ESRCH ;
3313
- ret = user_trap_syscall (__NR_getppid , flags );
3313
+ ret = user_notif_syscall (__NR_getppid , flags );
3314
3314
close (ret );
3315
3315
ASSERT_LE (0 , ret );
3316
3316
}
@@ -3328,8 +3328,8 @@ TEST(user_notification_kill_in_middle)
3328
3328
TH_LOG ("Kernel does not support PR_SET_NO_NEW_PRIVS!" );
3329
3329
}
3330
3330
3331
- listener = user_trap_syscall (__NR_getppid ,
3332
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3331
+ listener = user_notif_syscall (__NR_getppid ,
3332
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3333
3333
ASSERT_GE (listener , 0 );
3334
3334
3335
3335
/*
@@ -3382,8 +3382,8 @@ TEST(user_notification_signal)
3382
3382
3383
3383
ASSERT_EQ (socketpair (PF_LOCAL , SOCK_SEQPACKET , 0 , sk_pair ), 0 );
3384
3384
3385
- listener = user_trap_syscall (__NR_gettid ,
3386
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3385
+ listener = user_notif_syscall (__NR_gettid ,
3386
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3387
3387
ASSERT_GE (listener , 0 );
3388
3388
3389
3389
pid = fork ();
@@ -3452,8 +3452,8 @@ TEST(user_notification_closed_listener)
3452
3452
TH_LOG ("Kernel does not support PR_SET_NO_NEW_PRIVS!" );
3453
3453
}
3454
3454
3455
- listener = user_trap_syscall (__NR_getppid ,
3456
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3455
+ listener = user_notif_syscall (__NR_getppid ,
3456
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3457
3457
ASSERT_GE (listener , 0 );
3458
3458
3459
3459
/*
@@ -3489,8 +3489,8 @@ TEST(user_notification_child_pid_ns)
3489
3489
SKIP (return , "kernel missing CLONE_NEWUSER support" );
3490
3490
};
3491
3491
3492
- listener = user_trap_syscall (__NR_getppid ,
3493
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3492
+ listener = user_notif_syscall (__NR_getppid ,
3493
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3494
3494
ASSERT_GE (listener , 0 );
3495
3495
3496
3496
pid = fork ();
@@ -3529,8 +3529,8 @@ TEST(user_notification_sibling_pid_ns)
3529
3529
TH_LOG ("Kernel does not support PR_SET_NO_NEW_PRIVS!" );
3530
3530
}
3531
3531
3532
- listener = user_trap_syscall (__NR_getppid ,
3533
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3532
+ listener = user_notif_syscall (__NR_getppid ,
3533
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3534
3534
ASSERT_GE (listener , 0 );
3535
3535
3536
3536
pid = fork ();
@@ -3597,8 +3597,8 @@ TEST(user_notification_fault_recv)
3597
3597
3598
3598
ASSERT_EQ (unshare (CLONE_NEWUSER ), 0 );
3599
3599
3600
- listener = user_trap_syscall (__NR_getppid ,
3601
- SECCOMP_FILTER_FLAG_NEW_LISTENER );
3600
+ listener = user_notif_syscall (__NR_getppid ,
3601
+ SECCOMP_FILTER_FLAG_NEW_LISTENER );
3602
3602
ASSERT_GE (listener , 0 );
3603
3603
3604
3604
pid = fork ();
@@ -3649,7 +3649,7 @@ TEST(user_notification_continue)
3649
3649
TH_LOG ("Kernel does not support PR_SET_NO_NEW_PRIVS!" );
3650
3650
}
3651
3651
3652
- listener = user_trap_syscall (__NR_dup , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3652
+ listener = user_notif_syscall (__NR_dup , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3653
3653
ASSERT_GE (listener , 0 );
3654
3654
3655
3655
pid = fork ();
@@ -3743,7 +3743,7 @@ TEST(user_notification_filter_empty)
3743
3743
if (pid == 0 ) {
3744
3744
int listener ;
3745
3745
3746
- listener = user_trap_syscall (__NR_mknod , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3746
+ listener = user_notif_syscall (__NR_mknod , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3747
3747
if (listener < 0 )
3748
3748
_exit (EXIT_FAILURE );
3749
3749
@@ -3799,7 +3799,7 @@ TEST(user_notification_filter_empty_threaded)
3799
3799
int listener , status ;
3800
3800
pthread_t thread ;
3801
3801
3802
- listener = user_trap_syscall (__NR_dup , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3802
+ listener = user_notif_syscall (__NR_dup , SECCOMP_FILTER_FLAG_NEW_LISTENER );
3803
3803
if (listener < 0 )
3804
3804
_exit (EXIT_FAILURE );
3805
3805
0 commit comments