From patchwork Mon Apr 22 08:47:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13637995 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E81651C2B; Mon, 22 Apr 2024 08:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713775658; cv=none; b=fzJIXgxFAwQkitTqo9KG9DdZ7rMtLwdLVljQP4Wk4lDmvvl7wdTGEgNFJu3uU6bGvtLLdE2LWpSgKiv/O0h1tiD+3JF9lwoR5QUgy+o8l4UkA1xAK+vzVY4MSOuE9O8c30Sz01eGLedeGkVuKxo58N1IFJ7FEv6N+AOozOBv4i8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713775658; c=relaxed/simple; bh=M6QQiy27Yx7cZTOC0617KB9Ln6pKKwikPWIcgenY/bM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EgGULhX+objFR+0LYaRicRH4tBGHWFBLJtos9RhCBX+j6CqVVyMks+/KAy6d1hapkryY0SjiqCJmQrHl9NcWUimi4SFCymzdUnYPbUX7PNcZAg30zCqyyEvy+HA65HXmblqpNoerAxEWuEuouiXQximmIRf1ZEExVuqnI5bCTTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BhbYt1HW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BhbYt1HW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACF34C113CC; Mon, 22 Apr 2024 08:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713775657; bh=M6QQiy27Yx7cZTOC0617KB9Ln6pKKwikPWIcgenY/bM=; h=From:To:Cc:Subject:Date:From; b=BhbYt1HWBZxGe8p0rpcUIVFFy0qN3mUbgGQa+T/hdJ9oQJ5iN9QXtGO+1X2Qp+kcW q3FAb85uoScj1tMh7VK/q77eXzWKZQh5pt/OPtaDAEK6NzBtA4zbpekQbS/S73OKy+ S6K4J7+Gbcac0zubIdjxBgAfvUcmZPnk8iHEsua7yLLYoNI1nHquFFKokymhz1QsZ6 N2kiYbBilEozrmvprYGyC8M1TxF7Os+zPOSs7cNsuEML9MeP464uktwGfCcjzApu8s tW9zR6AyO4iX4WSS4f0h6ivopKwu9ye/MDbkwrxzhFXFzoptPuD2oe+4U9VpgigchB D5isfO4sruTJQ== 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 11:47:09 +0300 Message-ID: <20240422084717.3602332-1-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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); }