From patchwork Wed Feb 8 16:39:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13133248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03304C636CC for ; Wed, 8 Feb 2023 16:40:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73B9C6B0071; Wed, 8 Feb 2023 11:40:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EB826B0072; Wed, 8 Feb 2023 11:40:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B3906B007B; Wed, 8 Feb 2023 11:40:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4C86E6B0071 for ; Wed, 8 Feb 2023 11:40:20 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 24CE91A0E65 for ; Wed, 8 Feb 2023 16:40:20 +0000 (UTC) X-FDA: 80444687400.03.89DCE47 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 8223B1C001E for ; Wed, 8 Feb 2023 16:40:18 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WbTBU4bb; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675874418; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=/9gCt/DXMCz5FsPggffU4ASpM56svrE/8oAUHWynS+o=; b=Q2eNIb7N16utQCnzcsj7jy1fzipU0c7xB7GfZL77Ny3jqIDaEDpHfMNWdihUS+ojIMSO6B /TGNDGey6Tg5hyswpQJQE6PfgYxN9cGAknDBsWdYY4cmrMcEs62H4yYULAONzuC7WuMcRK eEZtPM7JXycgA9+S2PAPg23ZuzYcfII= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WbTBU4bb; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675874418; a=rsa-sha256; cv=none; b=MjrbZSDYEabqx4WBfj2nxinnpXZfPxATbxIieRYLn57la1Tcy07+SELMGLqMjaDAWXBeGt HBcwi7GoFkchXqVbPwxKJttbWcIUBpqphBSGP7beyhUOe/AiV+uKNce0wk+9AJBZAPufP3 H+SwOQoU8j/TyA3gUdU8pcDvBvmyOPE= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9CE7561718; Wed, 8 Feb 2023 16:40:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CEC1C433D2; Wed, 8 Feb 2023 16:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675874417; bh=+5YG0ew14LGHHwHHweKoIWpxQOFrZZOOumCgJpF1eCM=; h=From:To:Cc:Subject:Date:From; b=WbTBU4bbJfZy8N5AHyAEElkmZ0+jh4Z0bDAxfpPzv17D5tzwUiCXxp8oPouaj2eK/ 1BmCiw2rGIGBCI8XnBZ5ZvV3JYw1KgXr6F3oHdHze/wuRGyFR2hqdEfX0xFPNoMGRO /TNYy8dw4r4PBkTxJXd36hXR9rtLam1yu0wIUVRpwwxyAkSNTxt1QKp9rf/zM58dQY W2knpPx/3Ejks1aXkMt4xBmnThZp0+qPiXgff1uXhn7MIKU2WqlFBjJ2QEs2+nw0ua 2Q56IVf/AplSFNOOwaudlBMZT7cy5+N44tv0fRss47/F2TYFsmdVV31/d4e5Hl1Z+5 t0VunwZfiXPzA== From: Arnd Bergmann To: Josh Poimboeuf , Peter Zijlstra , Andrey Ryabinin , Andrew Morton Cc: kasan-dev@googlegroups.com, Marco Elver , Dmitry Vyukov , Alexander Potapenko , Vincenzo Frascino , Andrey Konovalov , Arnd Bergmann , Kuan-Ying Lee , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] kasan: mark addr_has_metadata __always_inline Date: Wed, 8 Feb 2023 17:39:55 +0100 Message-Id: <20230208164011.2287122-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 8223B1C001E X-Stat-Signature: yt95khstyg94w8zhieoxnp9zrp59eus8 X-HE-Tag: 1675874418-536630 X-HE-Meta: U2FsdGVkX1+h/mQPR3HgInaarLTovHq0WriTfgU+3Bw0Rod5qLOnh/JzEdY7H0bTKbQm5Fz4xWFvSW+MDOxFKW2pEVC7oUuyFEX/a3Sr0rWeyAX+7mXk43z6HfJYRpxstM1s7iwIqODUEeNgHlQQTpTt9ZOGVlPcQPkwrk/Y6ni5MjObctJunYAOZ2Wiuu4736Q8Tn4tC3yt/BLGj32RSF8cugTvoe3b7vxikIvYvOTEUpfAwEUsX8XvsoYjQnQCzbJyNaMuoaJo2e2kKuz1EW8w1gAIl6hWX2mcGcm+gue3PfLGTRXiI+sqjtCe95eiR4QZm3LxA2g27LoG43T6Xk80prLDnhOJzgkc9iGNnmjRG0Epp9E5k5a6lJhOthBZeK6mfPX4WnbVOQtW6SQ8MaznpEEU8MBixlER7jFDXwnGor+mC9NlQA1zJKjJ4j+YlplqltodzTt+KAXKv7qA4RTC3qitIfMayFAW74++8WwRdgfUrwidlNYwC/71YBOw7k+LYuK+P0gSGWtmEez/ZQFkEJ/TXd4j2ZWHSJz5cRchex2Xj3+2zLUEK4MzXnJXsa44JHSTfK0zLewuvEvg0ys4ezrdom+2k0lnoQDi626k2gvus0Q7whIWiMHTs1wqp4gEdHt3uzPcPkh3KfXlY0mlgbO4iZeDxUg/qUEtqtVwy7jcpiuGK7cprg26gZpF/L9IIMt+fGJxZVgTiKj4BCN1318BAq75iy/T/gmb7GBAyeqJOMTgUSSEmjwkVuZyftSS34Lnc8p788fu/OL/z8QkIeT5WwbgUJCST/nKDw+fvJrYsdWxD6xva0i6X+Whp9EREyeKQMfgLSMYyHW6Ea7UWNulU/X2DUKuxjvluSZY/UGtcP4vrbD5dcPO+sY/fgnem667FxrCgb2RbeYBF7Xim4rHrv5HdFqBB51Oy6LfW7IvmKrE/U7UTe5d0F0LX1kVn4JGCsDlxR4hx4f jvQkv1A/ iy7wyTP0gOvobgzEQ3JQj8N4Qs8UWqNB5ZE6WE8SXNoHKXP/XEKL5NfmCK253zg4P8tySIpeJkc69o7lNa4nf5nyA7dPEt7lDukU4QTuGjNhdFwEhewl3RXgcr3Sq7EXXvrjpFR6GorZQZDX5ml1KSsJqMoPNNZNbHwg84PSuqZClq4ocDldnaKIOnJ2rLaWgFMoJS1p801pVHltFbZwnDpZSGb0wEPMbZnj6Ccta/KEtECaze5Chae84NCmYXfDaiBfK2OJUMEkmHtDWJLygoCiuZJ77uMMBR8+zJIWCJiPS+Jz+tm8Aee1KEs9ZeRuAhnldF4qNFuLE++uCpkOoCw2Lrsx1qQZhn/ERlXxUl9hZWSSEx3lnBmnfqj84jRyOn9JZmLN3oAJTuAUN4eLykvFPkJQN3ZcsxTrf X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann When the compiler decides not to inline this function, objdump complains about incorrect UACCESS state: mm/kasan/generic.o: warning: objtool: __asan_load2+0x11: call to addr_has_metadata() with UACCESS enabled Signed-off-by: Arnd Bergmann Reviewed-by: Marco Elver Acked-by: Peter Zijlstra (Intel) Reviewed-by: Andrey Konovalov --- mm/kasan/kasan.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 3231314e071f..9377b0789edc 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -297,7 +297,7 @@ static inline const void *kasan_shadow_to_mem(const void *shadow_addr) << KASAN_SHADOW_SCALE_SHIFT); } -static inline bool addr_has_metadata(const void *addr) +static __always_inline bool addr_has_metadata(const void *addr) { return (kasan_reset_tag(addr) >= kasan_shadow_to_mem((void *)KASAN_SHADOW_START)); @@ -316,7 +316,7 @@ bool kasan_check_range(unsigned long addr, size_t size, bool write, #else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ -static inline bool addr_has_metadata(const void *addr) +static __always_inline bool addr_has_metadata(const void *addr) { return (is_vmalloc_addr(addr) || virt_addr_valid(addr)); } From patchwork Wed Feb 8 16:39:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13133249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF301C636CC for ; Wed, 8 Feb 2023 16:40:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B0C66B0072; Wed, 8 Feb 2023 11:40:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 760CB6B007B; Wed, 8 Feb 2023 11:40:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B3EE6B007D; Wed, 8 Feb 2023 11:40:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 480226B0072 for ; Wed, 8 Feb 2023 11:40:29 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 16B19120F33 for ; Wed, 8 Feb 2023 16:40:29 +0000 (UTC) X-FDA: 80444687778.18.9F86CE1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 997E9A0010 for ; Wed, 8 Feb 2023 16:40:26 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q1mVQCj5; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675874426; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xvTbmEyJDH308Mr1kfAgZiukxgBd5MJ/ejaniJVGR/0=; b=s48sGE4lpBnBIKs2QlJ9DGHT4B1pZEH9V0bePejyv7VeqCY6Vdjn1ZywW2Sb2RH3bJyWxw d/wECHVFQaVz1M9sSHD+GdHKFv/mLengaVQNqJTehEMJ7mXnr0rvcwb0KnHhWFgLskVyMW PAAWREXhDICfb+uU9YLOTNC4mk+uF2Y= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q1mVQCj5; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675874426; a=rsa-sha256; cv=none; b=sTbQAOE/3zGWdwnzeT3xFclV8db0F4HWm5lZ1RqNQQvgO0FPo+dPPOA0VchrEg4CUotOCH mncFpNbZKdSEw+nOoAAO+rpUp2qKL2I4ZodrNpprN4kYXZXQMxGbCrDNHOx7C0juFDEdTR +n0BGIVLRkVyKUOjbcvsJfdqkp6K7I8= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CBDE461718; Wed, 8 Feb 2023 16:40:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70A29C433D2; Wed, 8 Feb 2023 16:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675874425; bh=wo/uMi/XKqmv4ZfEoOSWzfRWU2jBLxW4mP+OJhOyZ2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q1mVQCj5l1GVpNB7Kz/TXLUj/sGQvi8ZPMLHBFoMpbCI8ebfhNAivUbJywKe175rQ bALfIw4nCofYgEs6piTnSGSdsEm8jDvdH4Fi7hUHrpwgz1jzJ0/qpiONTPMbdhMhfG lZymSFQ4arYPRqfeu7IycuYSeZxd5AVofIMCzFs2filiBmYlRv7RALWgeFBCtIYVHx q6H07blzaLAo2gzBWlOaCGXQyLNuh1ryaFSwEh1+bfuEGG2QMg3jE+KoeA4o8epStL EdOwr6QVCbwTH9HyqS5q3EmXl/NeHZxL2V9Nbwftx+Xujj4z5x9hyEXVu+AQ+IoYb2 hyeGjbdlKaxsw== From: Arnd Bergmann To: Josh Poimboeuf , Peter Zijlstra , Alexander Potapenko , Andrew Morton , Marco Elver Cc: kasan-dev@googlegroups.com, Dmitry Vyukov , Andrey Ryabinin , Vincenzo Frascino , Andrey Konovalov , Arnd Bergmann , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] kmsan: disable ftrace in kmsan core code Date: Wed, 8 Feb 2023 17:39:56 +0100 Message-Id: <20230208164011.2287122-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208164011.2287122-1-arnd@kernel.org> References: <20230208164011.2287122-1-arnd@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 997E9A0010 X-Stat-Signature: eppewtzi6dww1d916naz5frzt5xnzwri X-HE-Tag: 1675874426-569905 X-HE-Meta: U2FsdGVkX18XCq9Bc6oWV5uZZ2vEJKEaKklCmmT8nxW4fiZ5WPAuGVOsugzOV8hOa7ZHID8wpwcGYIKjyhooMStpbMYhrBeeT9nhtPjYam/O3KCddx+vJqPpTvLhYKJLQFc2pNq0E3/JRfxF2sW3B7WCpA0EUwZVsR6MKWgLk2Nn4sakoyR0sg3njvxFAHCNmqfQUmF1xWKNkJ1pNkxdsasSnx+rBoFit73MnFTSq0SlRZs+7mTcmkyAM2TTGOk9vB7MLKdN13tkw0DQJbr8RV7P1C/K5NJONPuHi5OxLFUi/pZxYOJRV2ala8r4Y7N/fkMS/Zq/rZY9Y2zPoVWah7oqKaAgBHhmEZXIvFNX0NJMb2Yqq6C9YFabo2nZNzqANuvicHeHliYlKwNscM8HEPfKfd/Tp0XJRRgcauyLX1kf/v3hQLKkycP0gh9oM7WbUh2tYD/mrpLCm0N9uGy0MTWn44NVYXI2/fgbARzbV59m/vfPlnvqfHMQ9Jkg3BICeOLNqtzY61M9g66N+R0EJKhfQbDCvAEyHW6YfZW0Lk2te7VAjj/nFKMRZpQDnPdfprhr+pFrmUSS1vRrOKe+TbjpFXrPUrXtnujMRPwhkTYljEvEq40HG/wEwEYgCoRKdr8/+vg0HJ3gfAAF6FLbvAX09EP15W9oh1EHp+zvRuQfubf9YfYUw4vRWTnIvoutbnXQWcPMk0wwxzoNuIAjiyTIuE+TE3lGAnfYtyF/bJDwcnazIxzv6gB9gLZa9e/hNMWstmZayKgJDonTB2RvcT7yabhcXtkMP33Dfa8PeVAEH2AS3rhDgsLlnBEeBqmEZtO+AU24gr6oCG68MJD7Yqm3TkE/6OWTtTTL9XCOXTjUrf3HPnEYP99pzd1IP1sYzl9hjdJSm2mhfe72TkT4CI/k3S9Ekz8FPbGDv9E9+pwPGTcCPEXbb+OVgBxewPysji9dHbqmO1a/+G5pLXx PxQYBnDo VYCpM8xla/CzzIibDT7/H5qIo5B5fvqjeu+U++VIIqxroTI3R+WtFzuaDN2jDrWoYgxF3fn3P1fta7/ePbJzQy2N9LXA1efxPmmNUQUYRQsgzyjMG1n+Aa4maR91/hFH3C+LXC/w8YniFsDBDUMDjc5bve4b69vxEUnKMC4kSS91NKDh8AU/huAlVxaFPaATp1X+ynTH5tiaaTZBx26ri9Yr5XUYleVMlPd60TB5NkhrordaAfuLug6nbXO5iEX7cF5YsioArsLbM+57gqJ+R0M53AbVgfx/aFY8MTUcCqR7Gg1RESCwDNQd3n2ijcCF4Nb5a+dyeIEFI8KTB2vNVsFbJxiRyZGi8oDTwyzkV6NushE8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann objtool warns about some suspicous code inside of kmsan: vmlinux.o: warning: objtool: __msan_metadata_ptr_for_load_n+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_store_n+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_load_1+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_store_1+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_load_2+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_store_2+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_load_4+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_store_4+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_load_8+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_metadata_ptr_for_store_8+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_instrument_asm_store+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_chain_origin+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_poison_alloca+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_warning+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: __msan_get_context_state+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: kmsan_copy_to_user+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: kmsan_unpoison_memory+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: kmsan_unpoison_entry_regs+0x4: call to __fentry__() with UACCESS enabled vmlinux.o: warning: objtool: kmsan_report+0x4: call to __fentry__() with UACCESS enabled Similar code already exists in kasan, which avoids this by skipping ftrace annotations, so do the same thing here. Fixes: f80be4571b19 ("kmsan: add KMSAN runtime core") Signed-off-by: Arnd Bergmann Acked-by: Alexander Potapenko --- mm/kmsan/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/kmsan/Makefile b/mm/kmsan/Makefile index 98eab2856626..389fd767a11f 100644 --- a/mm/kmsan/Makefile +++ b/mm/kmsan/Makefile @@ -16,6 +16,14 @@ CC_FLAGS_KMSAN_RUNTIME += -DDISABLE_BRANCH_PROFILING CFLAGS_REMOVE.o = $(CC_FLAGS_FTRACE) +# Disable ftrace to avoid recursion. +CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_hooks.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_instrumentation.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE) + CFLAGS_core.o := $(CC_FLAGS_KMSAN_RUNTIME) CFLAGS_hooks.o := $(CC_FLAGS_KMSAN_RUNTIME) CFLAGS_init.o := $(CC_FLAGS_KMSAN_RUNTIME)