linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] sched: sched_getattr should return E2BIG, not EFBIG
@ 2019-09-03 17:16 Thadeu Lima de Souza Cascardo
  2019-09-03 17:16 ` [PATCH 2/2] sched: allow sched_getattr with old size Thadeu Lima de Souza Cascardo
  0 siblings, 1 reply; 10+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2019-09-03 17:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, Thadeu Lima de Souza Cascardo

As documented and the behavior before commit 22400674945c (sched: Simplify
return logic in sched_read_attr()), sched_getattr should return E2BIG instead
of EFBIG when there is not enough space to copy sched_attr.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fixes: 22400674945c (sched: Simplify return logic in sched_read_attr())
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2477893dd069..0fd67281e656 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5129,7 +5129,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
 
 		for (; addr < end; addr++) {
 			if (*addr)
-				return -EFBIG;
+				return -E2BIG;
 		}
 
 		attr->size = usize;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-09-04 17:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-03 17:16 [PATCH 1/2] sched: sched_getattr should return E2BIG, not EFBIG Thadeu Lima de Souza Cascardo
2019-09-03 17:16 ` [PATCH 2/2] sched: allow sched_getattr with old size Thadeu Lima de Souza Cascardo
2019-09-04  7:55   ` [PATCH] sched/core: Fix uclamp ABI bug, clean up and robustify sched_read_attr() ABI logic and code Ingo Molnar
2019-09-04  8:49     ` [PATCH v2] " Ingo Molnar
2019-09-04  8:55       ` [PATCH v3] " Ingo Molnar
2019-09-04  9:31         ` Dietmar Eggemann
2019-09-04 10:39           ` Ingo Molnar
2019-09-04 10:55             ` Dietmar Eggemann
2019-09-04 13:19             ` Thadeu Lima de Souza Cascardo
2019-09-04 17:53               ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).