From f7d78c8b7d78482643499d73a14af2eb0700c5cc Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Fri, 10 Jul 2015 11:00:43 +0900 Subject: [PATCH] sched_getaffinity(): return EINVAL for 0 lenght request (fixes LTP sched_getaffinity01) --- kernel/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/syscall.c b/kernel/syscall.c index 55bbb49f..b67d7e52 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -4832,6 +4832,9 @@ SYSCALL_DECLARE(sched_getaffinity) unsigned long irqstate; extern int num_processors; + if (!len) + return -EINVAL; + len = MIN2(len, sizeof(k_cpu_set)); if(tid == 0)