@@ -457,10 +457,12 @@ static int audit_filter_rules(struct task_struct *tsk,
457
457
struct audit_field * f = & rule -> fields [i ];
458
458
struct audit_names * n ;
459
459
int result = 0 ;
460
+ pid_t pid ;
460
461
461
462
switch (f -> type ) {
462
463
case AUDIT_PID :
463
- result = audit_comparator (tsk -> pid , f -> op , f -> val );
464
+ pid = task_pid_nr (tsk );
465
+ result = audit_comparator (pid , f -> op , f -> val );
464
466
break ;
465
467
case AUDIT_PPID :
466
468
if (ctx ) {
@@ -2051,7 +2053,7 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid,
2051
2053
audit_log_format (ab , "pid=%d uid=%u"
2052
2054
" old-auid=%u new-auid=%u old-ses=%u new-ses=%u"
2053
2055
" res=%d" ,
2054
- current -> pid , uid ,
2056
+ task_pid_nr ( current ) , uid ,
2055
2057
oldloginuid , loginuid , oldsessionid , sessionid ,
2056
2058
!rc );
2057
2059
audit_log_end (ab );
@@ -2275,7 +2277,7 @@ void __audit_ptrace(struct task_struct *t)
2275
2277
{
2276
2278
struct audit_context * context = current -> audit_context ;
2277
2279
2278
- context -> target_pid = t -> pid ;
2280
+ context -> target_pid = task_pid_nr ( t ) ;
2279
2281
context -> target_auid = audit_get_loginuid (t );
2280
2282
context -> target_uid = task_uid (t );
2281
2283
context -> target_sessionid = audit_get_sessionid (t );
@@ -2300,7 +2302,7 @@ int __audit_signal_info(int sig, struct task_struct *t)
2300
2302
2301
2303
if (audit_pid && t -> tgid == audit_pid ) {
2302
2304
if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2 ) {
2303
- audit_sig_pid = tsk -> pid ;
2305
+ audit_sig_pid = task_pid_nr ( tsk ) ;
2304
2306
if (uid_valid (tsk -> loginuid ))
2305
2307
audit_sig_uid = tsk -> loginuid ;
2306
2308
else
@@ -2314,7 +2316,7 @@ int __audit_signal_info(int sig, struct task_struct *t)
2314
2316
/* optimize the common case by putting first signal recipient directly
2315
2317
* in audit_context */
2316
2318
if (!ctx -> target_pid ) {
2317
- ctx -> target_pid = t -> tgid ;
2319
+ ctx -> target_pid = task_tgid_nr ( t ) ;
2318
2320
ctx -> target_auid = audit_get_loginuid (t );
2319
2321
ctx -> target_uid = t_uid ;
2320
2322
ctx -> target_sessionid = audit_get_sessionid (t );
@@ -2335,7 +2337,7 @@ int __audit_signal_info(int sig, struct task_struct *t)
2335
2337
}
2336
2338
BUG_ON (axp -> pid_count >= AUDIT_AUX_PIDS );
2337
2339
2338
- axp -> target_pid [axp -> pid_count ] = t -> tgid ;
2340
+ axp -> target_pid [axp -> pid_count ] = task_tgid_nr ( t ) ;
2339
2341
axp -> target_auid [axp -> pid_count ] = audit_get_loginuid (t );
2340
2342
axp -> target_uid [axp -> pid_count ] = t_uid ;
2341
2343
axp -> target_sessionid [axp -> pid_count ] = audit_get_sessionid (t );
@@ -2435,7 +2437,7 @@ static void audit_log_task(struct audit_buffer *ab)
2435
2437
from_kgid (& init_user_ns , gid ),
2436
2438
sessionid );
2437
2439
audit_log_task_context (ab );
2438
- audit_log_format (ab , " pid=%d comm=" , current -> pid );
2440
+ audit_log_format (ab , " pid=%d comm=" , task_pid_nr ( current ) );
2439
2441
audit_log_untrustedstring (ab , current -> comm );
2440
2442
if (mm ) {
2441
2443
down_read (& mm -> mmap_sem );
0 commit comments