@@ -1230,26 +1230,22 @@ static int seccomp_do_user_notification(int this_syscall,
1230
1230
return -1 ;
1231
1231
}
1232
1232
1233
- static int __seccomp_filter (int this_syscall , const struct seccomp_data * sd ,
1234
- const bool recheck_after_trace )
1233
+ static int __seccomp_filter (int this_syscall , const bool recheck_after_trace )
1235
1234
{
1236
1235
u32 filter_ret , action ;
1236
+ struct seccomp_data sd ;
1237
1237
struct seccomp_filter * match = NULL ;
1238
1238
int data ;
1239
- struct seccomp_data sd_local ;
1240
1239
1241
1240
/*
1242
1241
* Make sure that any changes to mode from another thread have
1243
1242
* been seen after SYSCALL_WORK_SECCOMP was seen.
1244
1243
*/
1245
1244
smp_rmb ();
1246
1245
1247
- if (!sd ) {
1248
- populate_seccomp_data (& sd_local );
1249
- sd = & sd_local ;
1250
- }
1246
+ populate_seccomp_data (& sd );
1251
1247
1252
- filter_ret = seccomp_run_filters (sd , & match );
1248
+ filter_ret = seccomp_run_filters (& sd , & match );
1253
1249
data = filter_ret & SECCOMP_RET_DATA ;
1254
1250
action = filter_ret & SECCOMP_RET_ACTION_FULL ;
1255
1251
@@ -1307,13 +1303,13 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
1307
1303
* a reload of all registers. This does not goto skip since
1308
1304
* a skip would have already been reported.
1309
1305
*/
1310
- if (__seccomp_filter (this_syscall , NULL , true))
1306
+ if (__seccomp_filter (this_syscall , true))
1311
1307
return -1 ;
1312
1308
1313
1309
return 0 ;
1314
1310
1315
1311
case SECCOMP_RET_USER_NOTIF :
1316
- if (seccomp_do_user_notification (this_syscall , match , sd ))
1312
+ if (seccomp_do_user_notification (this_syscall , match , & sd ))
1317
1313
goto skip ;
1318
1314
1319
1315
return 0 ;
@@ -1355,8 +1351,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
1355
1351
return -1 ;
1356
1352
}
1357
1353
#else
1358
- static int __seccomp_filter (int this_syscall , const struct seccomp_data * sd ,
1359
- const bool recheck_after_trace )
1354
+ static int __seccomp_filter (int this_syscall , const bool recheck_after_trace )
1360
1355
{
1361
1356
BUG ();
1362
1357
@@ -1380,7 +1375,7 @@ int __secure_computing(void)
1380
1375
__secure_computing_strict (this_syscall ); /* may call do_exit */
1381
1376
return 0 ;
1382
1377
case SECCOMP_MODE_FILTER :
1383
- return __seccomp_filter (this_syscall , NULL , false);
1378
+ return __seccomp_filter (this_syscall , false);
1384
1379
/* Surviving SECCOMP_RET_KILL_* must be proactively impossible. */
1385
1380
case SECCOMP_MODE_DEAD :
1386
1381
WARN_ON_ONCE (1 );
0 commit comments