Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4416699imu; Mon, 14 Jan 2019 22:52:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN4qqv7zb+auHJCLV6gkgMZ3IHM9kEacLl1cDEqNOPTf0t74iBqZkPPMiMhxgRbY+WxTAU6N X-Received: by 2002:a17:902:f091:: with SMTP id go17mr2572607plb.235.1547535131037; Mon, 14 Jan 2019 22:52:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547535131; cv=none; d=google.com; s=arc-20160816; b=AHmZuPylywwQb9L+c8ItSxWTA3eNpShDowZfTOK/4SBCjMgD4KGsqt8ds4qIZ2DuWL 9BnexlAQzS/wXN8xFjVheN1FPn95qk6sgeBtRw5w/u3nH3rfSJgN1uK8v973X9oGkD1/ fhkNSB81af9L0WhbgpqUqARc1ok11Dm49BQOl7/zASpnWuGtgmB0X+IS42ODsk2vhDln Q9L9BrSXQvlDnTC90uH2FB1bqWaKPfjDJx+8e5QOM0OUkpxNFDfTzbp9DeFILA+Oi1DO dp6s8lay3Nr/y5AHi+9wsWKLlGeEw6qJV/Jk/yZxqFIKVc7cWfTZxyTdMS7HB18jw/f+ X6Mg== 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=O/MR858IaP4qC1AlmnQIT6Lmi5EZJ4c6Ir39+6UuO2I=; b=tClB1dYJ7YVLMOne7JpFcu5+pYETM0fNB+GPh3jjRiCehQmSCcgwD/fAVG72ZBnWFa IsZQYQJaOG4nuX7Jlsex1CWvR1ePsSs1lu9U+w3HMRrd9mgR18xuFLgrOax+9UW4qBvh zV2c05w/acDU96ttWp6uTIdSonNsbC2lMOo+FokIMYH6FAo1gDoQAjpr/LP41VY+J1uE MWP4bYhRYpDXV41xS4O3fN6ISv7A57CClGY+wJg4q/MYLhbFBmZnXkECS4WdrZoFMW2f qwzA5uYdX1TZaTe06ROdFJUEvvMpAy0oSW3lqSaPJwR1mhzUwnYD+zSSb1O/n4g2MfS+ UoeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BQnVjSJy; 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 a8si2375170pgw.380.2019.01.14.22.51.55; Mon, 14 Jan 2019 22:52:11 -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=BQnVjSJy; 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 S1728366AbfAOGZ3 (ORCPT + 99 others); Tue, 15 Jan 2019 01:25:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:41922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727273AbfAOGZ3 (ORCPT ); Tue, 15 Jan 2019 01:25:29 -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 3AC9C20651; Tue, 15 Jan 2019 06:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547533528; bh=QM7XOsAU0i1KQFQo/n6k/OXJ89dL3NSEi3PjGHYFhXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQnVjSJyhe5H/zxDjv/AU43qpcQRkrL87bktvAyvgQkOb/SIzsvOYaMnzFo6FPV/k JTRxeIgtVZEuVtbS/hBXTm/BZmzV2OShz/aebclSdn9Xey6nCKo3ZUZ4kOopD36/c8 NgTD+FjYX8Css5AWdEYAUwYxAlqkQj0gfei6UecY= 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 3/4] arm64: kprobes: Move exception_text check in blacklist Date: Tue, 15 Jan 2019 15:25:05 +0900 Message-Id: <154753350520.31541.11995657762766497151.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 Move exception/irqentry text address check in blacklist, since those are symbol based rejection. If we prohibit probing on the symbols in exception_text, those should be blacklisted. Signed-off-by: Masami Hiramatsu --- arch/arm64/kernel/probes/kprobes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index 1dae500d0a81..b9e9758b6534 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -98,9 +98,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) /* copy instruction */ p->opcode = le32_to_cpu(*p->addr); - if (in_exception_text(probe_addr)) - return -EINVAL; - if (search_exception_tables(probe_addr)) return -EINVAL; @@ -475,7 +472,8 @@ bool arch_within_kprobe_blacklist(unsigned long addr) (addr >= (unsigned long)__entry_text_start && addr < (unsigned long)__entry_text_end) || (addr >= (unsigned long)__idmap_text_start && - addr < (unsigned long)__idmap_text_end)) + addr < (unsigned long)__idmap_text_end) || + in_exception_text(addr)) return true; if (!is_kernel_in_hyp_mode()) {