lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  8 Jul 2021 15:44:11 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     akpm@...ux-foundation.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Cc:     andreyknvl@...il.com, catalin.marinas@....com, dvyukov@...gle.com,
        glider@...gle.com, mark.rutland@....com, ryabinin.a.a@...il.com,
        will@...nel.org
Subject: [PATCH] kasan: fix build for CONFIG_KASAN_HW_TAGS

When CONFIG_KASAN_HW_TAGS is selected, <linux/kasan.h> uses _RET_IP_,
but doesn't explicitly include <linux/kernel.h> where this is defined.

We used to get this via a transitive include, but since commit:

  f39650de687e3576 ("kernel.h: split out panic and oops helpers")

... this is no longer the case, and so we get a build failure:

|   CC      arch/arm64/mm/kasan_init.o
| In file included from arch/arm64/mm/kasan_init.c:10:
| ./include/linux/kasan.h: In function 'kasan_slab_free':
| ./include/linux/kasan.h:211:39: error: '_RET_IP_' undeclared (first use in this function)
|   211 |   return __kasan_slab_free(s, object, _RET_IP_, init);
|       |                                       ^~~~~~~~
| ./include/linux/kasan.h:211:39: note: each undeclared identifier is reported only once for each function it appears in
| ./include/linux/kasan.h: In function 'kasan_kfree_large':
| ./include/linux/kasan.h:219:28: error: '_RET_IP_' undeclared (first use in this function)
|   219 |   __kasan_kfree_large(ptr, _RET_IP_);
|       |                            ^~~~~~~~
| ./include/linux/kasan.h: In function 'kasan_slab_free_mempool':
| ./include/linux/kasan.h:226:34: error: '_RET_IP_' undeclared (first use in this function)
|   226 |   __kasan_slab_free_mempool(ptr, _RET_IP_);
|       |                                  ^~~~~~~~
| ./include/linux/kasan.h: In function 'kasan_check_byte':
| ./include/linux/kasan.h:277:35: error: '_RET_IP_' undeclared (first use in this function)
|   277 |   return __kasan_check_byte(addr, _RET_IP_);
|       |                                   ^~~~~~~~

Fix this by including <linux/kernel.h> explicitly.

Fixes: 6028bf777417 ("kernel.h: split out panic and oops helpers")
Signed-off-by: Mark Rutland <mark.rutland@....com>
Cc: Alexander Potapenko <glider@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@...il.com>
Cc: Andrey Ryabinin <ryabinin.a.a@...il.com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Will Deacon <will@...nel.org>
---
 include/linux/kasan.h | 1 +
 1 file changed, 1 insertion(+)

As a heads-up, there are some unrelated runtime issues with
CONFIG_KASAN_HW_TAGS and the recent arm64 string routines rework, which
I'm looking into now. If you boot-test with this applied, you should
expect to see those.

Andrew, I assume you'd be the one to pick this up?

Thanks,
Mark.

diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index 5310e217bd74..dd874a1ee862 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
@@ -3,6 +3,7 @@
 #define _LINUX_KASAN_H
 
 #include <linux/bug.h>
+#include <linux/kernel.h>
 #include <linux/static_key.h>
 #include <linux/types.h>
 
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ