Thread (9 messages) 9 messages, 3 authors, 2020-09-30

[PATCH] sched_getattr.2: update to include changed size semantics

From: Aleksa Sarai <hidden>
Date: 2019-11-28 12:09:32
Subsystem: the rest · Maintainer: Linus Torvalds

Due to a userspace breakage, commit 1251201c0d34 ("sched/core: Fix
uclamp ABI bug, clean up and robustify sched_read_attr() ABI logic and
code") changed the semantics of sched_getattr(2) when the userspace
struct is smaller than the kernel struct. Now, any trailing non-zero
data in the kernel structure is ignored when copying to userspace.

Ref: 1251201c0d34 ("sched/core: Fix uclamp ABI bug, clean up and
                    robustify sched_read_attr() ABI logic and code")
Signed-off-by: Aleksa Sarai <redacted>
---
 man2/sched_setattr.2 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/man2/sched_setattr.2 b/man2/sched_setattr.2
index 76ffa14eba85..fbb67b8eb98b 100644
--- a/man2/sched_setattr.2
+++ b/man2/sched_setattr.2
@@ -284,10 +284,8 @@ structure,
 the additional bytes in the user-space structure are not touched.
 If the caller-provided structure is smaller than the kernel
 .I sched_attr
-structure and the kernel needs to return values outside the provided space,
-.BR sched_getattr ()
-fails with the error
-.BR E2BIG .
+structure, the kernel will silently not return any values which would be stored
+outside the provided space.
 As with
 .BR sched_setattr (),
 these semantics allow for future extensibility of the interface.
-- 
2.24.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help