Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp800596imm; Mon, 21 May 2018 14:43:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpG6OyC+XiWU6vK8gV2hAM65bIyAgt5OtM9mUfIzXyut3ltbLOKrooVxw/i+csHiKkVswmQ X-Received: by 2002:a62:9d5a:: with SMTP id i87-v6mr21787728pfd.190.1526939025773; Mon, 21 May 2018 14:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526939025; cv=none; d=google.com; s=arc-20160816; b=jtUH6yQWkr0vY55MhTLdQbSWhRltb7Yihd+Sh678RshRfivRm4hbRLpUErBFdyh616 BUPhJa1FrRhQsfzLEnC3EFYT9pqeOnt0IiydD+uaQBybNu95o4hH9cSJKusvzCpXg7VS M+gVYbv2cbxVAitKUNueFhus+GXr0qsFc6594N3L0/z9+TPNx8f6DHBA50x8Aj0uquM3 24h+Qw/dKiG+3VYuJLQNyc+JPiSZrQ9kZ7ocYyb7gdbtQ7GYjS4B2b3ddbyfTm/63ApZ FTBjs4pU6vVqkQo4dMKcJsC2aJcZyGN/+CEwSnW+hJehu1BkbYPLq8AlhS4noHVswS5C XNAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=kOzkMCZat7j5iJJ6wfKG9DgPq86ztMlOPFUaQxZpWys=; b=lQduQGDbxWXZZU9+15ji7Rq9kpsEPW8e1UrMcSimlLUXs1X5xWDXUN/NeDNHwEsp0X C/AwqcVxE20t0hH0ums7COOuqHrEG5+BPcXVc/IsGbaRaXvo/7pFm/3VZHKyrmsqYqKf iujyVaM9Gvx6DCjc24BPOY/HDNllk+vnjEePIsWmQgnoh+T2pu6VZ9nDgG1YDbDQugcI bnVLi4IBO6h5OuznPF0G96k9M6j8/TXoAteb4tXTA5o9J5Y3ab/qxn7h9Nlt/xS3j/eo s1Ph0o8gzBILF0gXGfXojHOPXD+Ut3eyyQCk+ftHv8Ek43zkPz2eQF1X7hMIA+8BPSDe Kxtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OTY8Ys7W; 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 b18-v6si3707390pgs.668.2018.05.21.14.43.31; Mon, 21 May 2018 14:43:45 -0700 (PDT) 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=OTY8Ys7W; 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 S932253AbeEUVYR (ORCPT + 99 others); Mon, 21 May 2018 17:24:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:39090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeEUVYK (ORCPT ); Mon, 21 May 2018 17:24:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 7377920873; Mon, 21 May 2018 21:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937850; bh=LzxkRJepZ/KAfk1KypKgl/A2j7oVuEtnQ2Euzj13Dfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OTY8Ys7WNYzoXwlzVHQZiSu3stNOy4HBXJIWgi5n9f90ZESPZjgx0gGv5RHrqqrsE 8f0R5uZP6Ys3Cmb2aNbLTbYqZhSvHCzbuNofRHqd+Lq5MzWRVgOBovvuLhqAHy8+MI gMyre0nBGoJrhJ8UbcBIuzWLlNRYxH1ake9DCtak= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Russell King Subject: [PATCH 4.16 048/110] ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr Date: Mon, 21 May 2018 23:11:45 +0200 Message-Id: <20180521210508.942917094@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit eb0146daefdde65665b7f076fbff7b49dade95b9 upstream. Prohibit kprobes on do_undefinstr because kprobes on arm is implemented by undefined instruction. This means if we probe do_undefinstr(), it can cause infinit recursive exception. Fixes: 24ba613c9d6c ("ARM kprobes: core code") Signed-off-by: Masami Hiramatsu Cc: stable@vger.kernel.org Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/traps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -417,7 +418,8 @@ void unregister_undef_hook(struct undef_ raw_spin_unlock_irqrestore(&undef_lock, flags); } -static int call_undef_hook(struct pt_regs *regs, unsigned int instr) +static nokprobe_inline +int call_undef_hook(struct pt_regs *regs, unsigned int instr) { struct undef_hook *hook; unsigned long flags; @@ -490,6 +492,7 @@ die_sig: arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); } +NOKPROBE_SYMBOL(do_undefinstr) /* * Handle FIQ similarly to NMI on x86 systems.