]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: remove usercopy_warn()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 22 Mar 2022 21:47:46 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:11 +0000 (15:57 -0700)
Users of usercopy_warn() were removed by commit 8dc42706f477 ("mm:
remove HARDENED_USERCOPY_FALLBACK")

Remove it.

Link: https://lkml.kernel.org/r/5f26643fc70b05f8455b60b99c30c17d635fa640.1644231910.git.christophe.leroy@csgroup.eu
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/uaccess.h
mm/usercopy.c

index ac0394087f7d4d2ad569eeca9dba0e8c50893d23..bca27b4e5eb2d587037f2152137324f7bff99287 100644 (file)
@@ -401,8 +401,6 @@ static inline void user_access_restore(unsigned long flags) { }
 #endif
 
 #ifdef CONFIG_HARDENED_USERCOPY
-void usercopy_warn(const char *name, const char *detail, bool to_user,
-                  unsigned long offset, unsigned long len);
 void __noreturn usercopy_abort(const char *name, const char *detail,
                               bool to_user, unsigned long offset,
                               unsigned long len);
index d0d268135d96d6494949bb5eec702f7365ddc86a..e7b0cb49daa1bef5f57bc0c7496ba5dca3bc1534 100644 (file)
@@ -70,17 +70,6 @@ static noinline int check_stack_object(const void *obj, unsigned long len)
  * kmem_cache_create_usercopy() function to create the cache (and
  * carefully audit the whitelist range).
  */
-void usercopy_warn(const char *name, const char *detail, bool to_user,
-                  unsigned long offset, unsigned long len)
-{
-       WARN_ONCE(1, "Bad or missing usercopy whitelist? Kernel memory %s attempt detected %s %s%s%s%s (offset %lu, size %lu)!\n",
-                to_user ? "exposure" : "overwrite",
-                to_user ? "from" : "to",
-                name ? : "unknown?!",
-                detail ? " '" : "", detail ? : "", detail ? "'" : "",
-                offset, len);
-}
-
 void __noreturn usercopy_abort(const char *name, const char *detail,
                               bool to_user, unsigned long offset,
                               unsigned long len)