From patchwork Sat Feb 4 10:18:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13128648 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4358EC636CC for ; Sat, 4 Feb 2023 10:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=80nN6d7v/sam6EmH8A7VzGQ7w66ptDAZN+/E9kae5UI=; b=JreHqHYh8TSVow PFpJSrUISQwj60E+BHr3ngQYi2NcPgjF+IP1igu8YfuCeo5Pb1hDTuEHm82tGX2ysMJovuOaN5bRO h9TByRIiF2eJMG7l9/jT6iRucdHarNf8d0P8xm602JC6zsUbC5MEszyTUQQRRCFRL6byKxUhccosx F4s+s+nqJ3S/hmWm/nFYFo8w8z6kBKCRB/U8T9OZVABWdpxYgR1TS22c9mQYO4DtRj686Gjn/fBd6 NAYKE6q0oWmkqAg1RJk7Og7tP4fr5cMAc2AUDsORmq0HuooJ2RMWRAsuUURbOjAzj/AeNUCQF1MIZ 5/gz3MTBQqsxhttYBEyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOFcm-004rms-Rl; Sat, 04 Feb 2023 10:18:24 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOFck-004rmL-6v for linux-arm-kernel@lists.infradead.org; Sat, 04 Feb 2023 10:18:23 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id DB98CB80AB7; Sat, 4 Feb 2023 10:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69852C433D2; Sat, 4 Feb 2023 10:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675505897; bh=h48oSWJ+f6SaKCD1JH7X4nE7gxgrtjhMDxT9twMHh9o=; h=From:To:Cc:Subject:Date:From; b=TYewHcQ+V2GTlpyMfXoI++zh+Aag0JoNdYlcGkQZHD87Od3sDN7cB8RaDe68G2Rsu lXlz1wfZibhd/x364DEDDOsUaBxAxMzRrf2kjb096m9hJPk46L/L/X1sP3WzotD2gC ViDw2qv8OtE3nLFYQQSHqvvGRCb+i0b6jVSJzYptvBoy771QanGeK/bgkaH5QGoXqu W7GuSF5r/TKEjqo3ipnqQl8Vou08flpmPeRMNysK8/aeppQQsSzHQuAMy/MmtJcITg 9jro976WFjpnTWNk5ReuA+QCDBoBpgkdUJ3FImOt051tiUZJr9YrhBqixniVeG1znW hfSgOd3DrnRNw== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will@kernel.org, Ard Biesheuvel , Nathan Chancellor Subject: [PATCH] arm64: kprobes: Drop ID map text from kprobes blacklist Date: Sat, 4 Feb 2023 11:18:07 +0100 Message-Id: <20230204101807.2862321-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1392; i=ardb@kernel.org; h=from:subject; bh=h48oSWJ+f6SaKCD1JH7X4nE7gxgrtjhMDxT9twMHh9o=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBj3jDemeYsvqanGXwGPwCtC2oFS+sqss7eoQKxa gjSx0rw1r2JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY94w3gAKCRDDTyI5ktmP JEsVC/wNb/sF8ODjJQqmImeIqtxscFA45TKNojbhoZR/xKnZg6pL5kHzKRY5xQfAm66ztEPPPGO f00HyjW81AGCX3l0lyWM1PF4oqHNCpbJNHbY0BjVBqNGs30Aeq1X4B4QxpjCWPja74oC+zV/kh7 GU0obK7LD33EgdZ4H8lXpZy/MoxBjx/CSwSvmzsFLzy8RoZrt7EgP4JCUVY5vP5Omd2GygqafgK uJBvnETCchnrft9mSGucjQVgy145ba6wu6Jww+rH5Ny79Er5EGU4CJx9vWNe0ayQNvKsRMOFTUx AhI3NO2cUdcZuE2cCzqL08Kp3swII9kSQI+oNiVVON5+HUOiEmR2ZSDP0iRjcjaGUY59JUR7Vuc +3cg7ROtNHS14YookmsKSmGP1kcVYfaUrGKE2F9pBA/0PT7/OdD8ruXUQ79r6QCLcKFNH2E0PBm jbNp613LZSa/gymvH3Vb9fUXYqWWVEPAs45hkaF0YnycUNITjD1z+V/t9xffS8Ldp3h1Q= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230204_021822_424521_3DC0AA44 X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ID mapped text region is never accessed via the normal kernel mapping of text, and so it was moved into .rodata instead. This means it is no longer considered as a suitable place for kprobes by default, and the explicit blacklist is unnecessary, and actually results in an error message at boot: kprobes: Failed to populate blacklist (error -22), kprobes not restricted, be careful using them! So stop blacklisting the ID map text explicitly. Fixes: af7249b317e4d0b3d ("arm64: kernel: move identity map out of .text mapping") Reported-by: Nathan Chancellor Signed-off-by: Ard Biesheuvel Tested-by: Nathan Chancellor Acked-by: Mark Rutland --- arch/arm64/kernel/probes/kprobes.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index f35d059a9a366fa6..70b91a8c6bb3f358 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -387,10 +387,6 @@ int __init arch_populate_kprobe_blacklist(void) (unsigned long)__irqentry_text_end); if (ret) return ret; - ret = kprobe_add_area_blacklist((unsigned long)__idmap_text_start, - (unsigned long)__idmap_text_end); - if (ret) - return ret; ret = kprobe_add_area_blacklist((unsigned long)__hyp_text_start, (unsigned long)__hyp_text_end); if (ret || is_kernel_in_hyp_mode())