From patchwork Mon Apr 22 09:44:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13638117 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 28335C4345F for ; Mon, 22 Apr 2024 09:45:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0A2A6B0087; Mon, 22 Apr 2024 05:45:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB8F66B00B5; Mon, 22 Apr 2024 05:45:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9599B6B00BA; Mon, 22 Apr 2024 05:45:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 77D796B0087 for ; Mon, 22 Apr 2024 05:45:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2BB0D1C101C for ; Mon, 22 Apr 2024 09:45:14 +0000 (UTC) X-FDA: 82036684548.04.AA54CF2 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf21.hostedemail.com (Postfix) with ESMTP id 24A031C0003 for ; Mon, 22 Apr 2024 09:45:11 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OAUECGGR; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713779112; 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=xy/onuXdQ30KVEaYuNUZWEt3SxlLWflAgQY6tAjVj70=; b=sjMaAjYksn17VYvTp+ww/jiLWVBChaKrs9zmyAcfvesricEms9f/LHaU4nBKV1F1MFA5Kn 8+fCLKwQbVmltiC+rpi0JdKgQZwtMKHLsTsYoAlzopMZom1PSZ4Eeli3NyoB9taZOPPwHc +vMQf4k1dB3fR//JWKz230+CqbBBFX0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OAUECGGR; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713779112; a=rsa-sha256; cv=none; b=xOL0ES/snj55j+O9xjvqc+BOre1csQEBZB2rag0snPC0oNsdz+ONzgB69if5/WO3FWwPdL kHSR4GJo1KggdDkhlPP9jyRait+tiVTI+HtGs0A0WGoBp5pnbumN5sDQWJK0KXON3HPJ1X sV7zTK8Av4wU345ADKvYp8e5eh8vj/M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id ED42FCE0AAF; Mon, 22 Apr 2024 09:45:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB5F2C3277B; Mon, 22 Apr 2024 09:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713779108; bh=M6QQiy27Yx7cZTOC0617KB9Ln6pKKwikPWIcgenY/bM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAUECGGRTEiKkEUXDWkCZhL/V/U9BbPBTVDZOjBgXLuYYd2AJNTN6WKrD4EVU90d/ 3ZQMsutxROUopphOrd/sFleszPmu739uhDR2NfjC3XHousm6bnqIKmRrlLtlSfKoIN OKEMTMtJbdJQB79EaCqjoN/qhQdiUnnzo4/ex2fD1aRS/gubP7X5jaHZB4IqtUbO0j mSUuYcQwxmnqwwpAQelzwWBBouR3r3mqPaRCCv71bV/SGCyurcNqgqcROjcC/PebDL MSNArLRvkhpArDvfRjmq6RZY0gSUxDQzJ1R5zaNJ+FMq4kuYiHl41b2XWJunMLvI2F ITr7RNoL2CYLQ== From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexandre Ghiti , Andrew Morton , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Michael Ellerman , Mike Rapoport , Nadav Amit , Palmer Dabbelt , Peter Zijlstra , Rick Edgecombe , Russell King , Sam Ravnborg , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: [PATCH v5 01/15] arm64: module: remove unneeded call to kasan_alloc_module_shadow() Date: Mon, 22 Apr 2024 12:44:22 +0300 Message-ID: <20240422094436.3625171-2-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240422094436.3625171-1-rppt@kernel.org> References: <20240422094436.3625171-1-rppt@kernel.org> MIME-Version: 1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99riernUvdD92V7 ioKBPU1E gbvs+/f/wLoHF5y1bChmpwqPzbryM5Q9JwqYxXMtorEwK6Gs6E/FVJBfzZnZt7IusnuGcSAlJDI9N0z9z7VMRLM3B6OHxjpK9ALGZIQc/aLA/H/YHVdGUFIWkfPxaVyi20KjmAhT1c8o2d1wMgMymtf5s400p84PSoFOGytSRVBbht+V1H2N6S8HtL4FODKtAMh5vL/CdPwHbIbOKB5g1cWaEJv14PofRrfbJ6irNP4Ulua9UZnukEKMvTAwwuIKGWzjjXRyZabKv3bZuKR5xfY4GDLpdR4YsPtBcs3hXzMpyWsmIrUP6IWKlBha9MD8M5Qmgck/4X5bV1ziav7GznE9PzDQSJ4lFOLbfMmR91VKJycI= 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: List-Subscribe: List-Unsubscribe: From: "Mike Rapoport (IBM)" Since commit f6f37d9320a1 ("arm64: select KASAN_VMALLOC for SW/HW_TAGS modes") KASAN_VMALLOC is always enabled when KASAN is on. This means that allocations in module_alloc() will be tracked by KASAN protection for vmalloc() and that kasan_alloc_module_shadow() will be always an empty inline and there is no point in calling it. Drop meaningless call to kasan_alloc_module_shadow() from module_alloc(). Signed-off-by: Mike Rapoport (IBM) --- arch/arm64/kernel/module.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c index 47e0be610bb6..e92da4da1b2a 100644 --- a/arch/arm64/kernel/module.c +++ b/arch/arm64/kernel/module.c @@ -141,11 +141,6 @@ void *module_alloc(unsigned long size) __func__); } - if (p && (kasan_alloc_module_shadow(p, size, GFP_KERNEL) < 0)) { - vfree(p); - return NULL; - } - /* Memory is intended to be executable, reset the pointer tag. */ return kasan_reset_tag(p); }