Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4415109imu; Mon, 14 Jan 2019 22:49:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN5k14zqf2NQsusY++CYLtplG7iWL7VUH3ACF5NwHi9/ALTOT0MfswvQQEi42Wz6dB82sEpP X-Received: by 2002:a63:da14:: with SMTP id c20mr2322400pgh.233.1547534996573; Mon, 14 Jan 2019 22:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547534996; cv=none; d=google.com; s=arc-20160816; b=03n7k53VCK5OjlEP8ntIbOdFkp6AuD/1yrnCjHMJ53/lofXHBSGZeRDsCiMFUO3QyC en6H2z0ZBr6KAstMc/ZTnosOH3at+H8Nfb4Ubr4hO0rIIpH0l+MXmCKbXHH9LFpPG4qg +6pPHc/aWA1eK/Odnj1c/cn7bbw/bzUPtfWaD9YyyNOecTICYeBMRGOtIsripK919ZcP tWy2f0sW0r4EDgKS+Ut9uLghVbi1zk7ia98Ixapri0zhVYYlqb3+6ev9jh4vSCZu/Gfv kjl+L7oYCmQ43PlqNkL9K8AqZfQMuKU5Uq9kiJH/mqlY2mcqA+lFi4NCifdPdSFT3t/5 6NJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IZGmdjZD+dkVb3MK0bBvNZ2VCV+zp2759QW8vVn6ICk=; b=u4Tesbe5cRiG+By2r7w6m0/ymEOXktQF8TA8+B4lYZtI517zcXiFTw8LG4LNndTux7 NHq9yNAIRYPjxde4Uy0s6nuxQPM1y46gUtW/Cyr5PJEryhNOJY9uY/8x263oNapPqzTq Et1BTVHgFpaCFTYJ+rBfeRqQztjyvf+KPbJwH9rnlxGa3ULVZMA67hnhoeA7akhb1aqh ynLuIhDFsXqTA3pyRGyucBTT3f0oulJvx5E5qGanFqmDjyowDPlTcmnvEUaZqA2kDY8X eGg0vam4PCyyX58wroZcY3flz2qd6jFHRsxPPE4t7OAiPr4ExyRvOy4e5C+V9QcitWTX 6O2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xaxRNC5T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si2300250plt.356.2019.01.14.22.49.41; Mon, 14 Jan 2019 22:49:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xaxRNC5T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbfAOGZA (ORCPT + 99 others); Tue, 15 Jan 2019 01:25:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:41674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727470AbfAOGZA (ORCPT ); Tue, 15 Jan 2019 01:25:00 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B2C5020651; Tue, 15 Jan 2019 06:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547533499; bh=0xtxfZtFdIUmaXPj2hBVcHLm0ZupOdVKMg42UdHhv0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xaxRNC5TU7mwE4kCafxai/8OXGNAt1p6TBuFLDs755hYV+NpzHfTp+UCSIkQtbUtg Kxm5h2EQhd2+quCvpWCzOC2csDJY17wbZqs6zRdAluJR0okey87/cbt0nS07aTOKeA HnxMbXMMGKxU8E1Vrj6Q64otx6HiRzFzihk67BWY= From: Masami Hiramatsu To: Catalin Marinas , Will Deacon Cc: Masami Hiramatsu , Pratyush Anand , "David A . Long" , linux-arm-kernel@lists.infradead.org, linux-kernel , James Morse Subject: [PATCH v2 2/4] arm64: kprobes: Remove unneeded RODATA check Date: Tue, 15 Jan 2019 15:24:36 +0900 Message-Id: <154753347659.31541.11277302003578292109.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <154753341900.31541.8135985235882849464.stgit@devbox> References: <154753341900.31541.8135985235882849464.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unneeded RODATA check from arch_prepare_kprobe(). Since check_kprobe_address_safe() already ensured that the probe address is in kernel text, we don't need to check whether the address in RODATA or not. That must be always false. Signed-off-by: Masami Hiramatsu --- arch/arm64/kernel/probes/kprobes.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index b2d4b7428ebc..1dae500d0a81 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -91,8 +91,6 @@ static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) int __kprobes arch_prepare_kprobe(struct kprobe *p) { unsigned long probe_addr = (unsigned long)p->addr; - extern char __start_rodata[]; - extern char __end_rodata[]; if (probe_addr & 0x3) return -EINVAL; @@ -106,10 +104,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) if (search_exception_tables(probe_addr)) return -EINVAL; - if (probe_addr >= (unsigned long) __start_rodata && - probe_addr <= (unsigned long) __end_rodata) - return -EINVAL; - /* decode instruction */ switch (arm_kprobe_decode_insn(p->addr, &p->ainsn)) { case INSN_REJECTED: /* insn not supported */