]> Gentwo Git Trees - linux/.git/commit
mm: security: Check early if HARDENED_USERCOPY is enabled
authorMel Gorman <mgorman@techsingularity.net>
Thu, 23 Jan 2025 22:11:14 +0000 (22:11 +0000)
committerKees Cook <kees@kernel.org>
Wed, 12 Feb 2025 21:40:17 +0000 (13:40 -0800)
commitfe348e05890776897acb931eb39987fcef0f6f65
tree9100179db04d1dfb7968c09bad3e6d77a3209cd7
parentcaba7c35e832c8cc2d8f3ecaa0d6ce8c8872a582
mm: security: Check early if HARDENED_USERCOPY is enabled

HARDENED_USERCOPY is checked within a function so even if disabled, the
function overhead still exists. Move the static check inline.

This is at best a micro-optimisation and any difference in performance
was within noise but it is relatively consistent with the init_on_*
implementations.

Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Link: https://lore.kernel.org/r/20250123221115.19722-4-mgorman@techsingularity.net
Signed-off-by: Kees Cook <kees@kernel.org>
include/linux/thread_info.h
mm/usercopy.c