Commit e52d60d1 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by ZhangPeng
Browse files

admin-guide/hw-vuln/core-scheduling: fix return type of PR_SCHED_CORE_GET

stable inclusion
from stable-v6.6.32
commit 1266e5a8f5bceb828bf3456fee08c0a81bd9b283
bugzilla: https://gitee.com/openeuler/kernel/issues/IA4MGD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1266e5a8f5bceb828bf3456fee08c0a81bd9b283

--------------------------------

commit 8af2d1ab78f2342f8c4c3740ca02d86f0ebfac5a upstream.

sched_core_share_pid() copies the cookie to userspace with
put_user(id, (u64 __user *)uaddr), expecting 64 bits of space.
The "unsigned long" datatype that is documented in core-scheduling.rst
however is only 32 bits large on 32 bit architectures.

Document "unsigned long long" as the correct data type that is always
64bits large.

This matches what the selftest cs_prctl_test.c has been doing all along.

Fixes: 0159bb02 ("Documentation: Add usecases, design and interface for core scheduling")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/util-linux/df7a25a0-7923-4f8b-a527-5e6f0064074d@t-8ch.de/


Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Reviewed-by: default avatarChris Hyser <chris.hyser@oracle.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240423-core-scheduling-cookie-v1-1-5753a35f8dfc@weissschuh.net


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 24ed5e1b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ arg4:
    will be performed for all tasks in the task group of ``pid``.

arg5:
    userspace pointer to an unsigned long for storing the cookie returned by
    ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.
    userspace pointer to an unsigned long long for storing the cookie returned
    by ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.

In order for a process to push a cookie to, or pull a cookie from a process, it
is required to have the ptrace access mode: `PTRACE_MODE_READ_REALCREDS` to the