Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4698385imu; Tue, 15 Jan 2019 04:36:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN5xicDPHwkUTSOKmKjnoyzPAgVdOPu8ETzwHWQqkaxMDItZ92PIuGN5LHwtYSOCFTURowRV X-Received: by 2002:a17:902:2a66:: with SMTP id i93mr3849564plb.113.1547555793492; Tue, 15 Jan 2019 04:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547555793; cv=none; d=google.com; s=arc-20160816; b=L9qC8BTraipgE8tGAC3MSM3MVIgMSssBGC1Cp4MchmoOi9ZNx+opyuKWzn2Qp8h/QL 8y9A6X95Vi2VHLtE9l6cb7o4CXLe5OAb6f/WYEpSrTTlxZ7JlpgCJ13NwOcXD6DvWhPo hlEpfpMH3vY74Nwd5sxLUbi/ecOfGuGSlCv1yUc/4B6vhLRGywL2z6dZ8idY1aZCRGEk 95y9UiSDgugKslBE2HjBGjj7VK/qEhUdvGk6I++laTLBYlnKnsyl7wiNcrMCLkj+1Cq1 7rmyEJHngsXDtnYqOoDexZLAM5E73r1Tk04jApa7GPakktdLF2N0iCeyYtmIb4Gup3i4 PNCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yNRRTdHGZBKT1SPoCFmKKOVhS/cKjl+Yi8HVVjl62Bs=; b=EWsUKwf0yBvFnXt7tu4mwSuJeQMpSnA6GxF2xvBJ5eWxQU8p55lzDZzF7PlIh01jsd jNyi+aP05QMLJHxi44sjwE4AhpD25ktQAklTvlJ4LjHhEOR/3aNuap5/AlNHON1qk/7R mwWNFwry20iWT77LsoyS0K1T2wER8mTC3mnPQD4lC8ohuZ9qPW8UnfqwOsaclkVEHut2 8kwxORR5P9/2ul5qfMeH6fVJ2p6rMGUY1F+o2ex5bVh66mKqFL+lHYu5h7fZ7s532p2Y UQ6gg1voLsdRloEoLhg7YyVq49x6SeL/qmqO1JUJSuPQIaptTstRlXakJ2MkdAlwMbLt hr5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc16si3262556plb.377.2019.01.15.04.36.15; Tue, 15 Jan 2019 04:36:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbfAOLUV (ORCPT + 99 others); Tue, 15 Jan 2019 06:20:21 -0500 Received: from foss.arm.com ([217.140.101.70]:48258 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728307AbfAOLUV (ORCPT ); Tue, 15 Jan 2019 06:20:21 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B02A1596; Tue, 15 Jan 2019 03:20:21 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9487D3F70D; Tue, 15 Jan 2019 03:20:19 -0800 (PST) Date: Tue, 15 Jan 2019 11:20:17 +0000 From: Mark Rutland To: Masami Hiramatsu Cc: Catalin Marinas , Will Deacon , Pratyush Anand , "David A . Long" , linux-arm-kernel@lists.infradead.org, linux-kernel , James Morse Subject: Re: [PATCH v2 2/4] arm64: kprobes: Remove unneeded RODATA check Message-ID: <20190115112016.GD43491@lakrids.cambridge.arm.com> References: <154753341900.31541.8135985235882849464.stgit@devbox> <154753347659.31541.11277302003578292109.stgit@devbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <154753347659.31541.11277302003578292109.stgit@devbox> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 03:24:36PM +0900, Masami Hiramatsu wrote: > 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 Reviewed-by: Mark Rutland Mark. > --- > 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 */ >