sched_setaffinity/sched_setaffinity01:kill child only when pid is positive
PATCH 1/1 sched_setaffinity/sched_setaffinity01:kill child only when pid is positive
If fork() failed, the privileged_pid will be equal to -1. Then the kill() in the cleanup() will kill almost all processes on the system.
Signed-off-by Han Pingtian <[email protected]>
--- testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c +1 -1
@@ -84,7 +84,7 @@ static void cleanup(void)SAFE_SETEUID (NULL , uid); -if (privileged_pid !=0 ) { +if (privileged_pid >0 ) {kill (privileged_pid,SIGKILL );waitpid (privileged_pid,NULL ,0 ); privileged_pid =0 ;
Signature · 1 line
1.9.3
PATCH 1/1 sched_setaffinity/sched_setaffinity01:kill child only when pid is positive
Hi!
Applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]