Commit 055f9b5d authored by Linus Torvalds's avatar Linus Torvalds Committed by Zhao Wenhui
Browse files

sched/membarrier: reduce the ability to hammer on sys_membarrier

stable inclusion
from stable-v5.10.210
commit db896bbe4a9c67cee377e5f6a743350d3ae4acf6
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I93SNV
CVE: CVE-2024-26602

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



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

commit 944d5fe50f3f03daacfea16300e656a1691c4a23 upstream.

On some systems, sys_membarrier can be very expensive, causing overall
slowdowns for everything.  So put a lock on the path in order to
serialize the accesses to prevent the ability for this to be called at
too high of a frequency and saturate the machine.

Reviewed-and-tested-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: default avatarBorislav Petkov <bp@alien8.de>
Fixes: 22e4ebb9 ("membarrier: Provide expedited private command")
Fixes: c5f58bd5 ("membarrier: Provide GLOBAL_EXPEDITED command")
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
[ converted to explicit mutex_*() calls - cleanup.h is not in this stable
  branch - gregkh ]
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhao Wenhui <zhaowenhui8@huawei.com>
parent a828e118
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment