Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2039575imm; Thu, 24 May 2018 04:58:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpjtdcZpZWeAoSq05nkVBdDtQ8OPpU2dn+hqsE9qnJD6dDYJO/dK3eDde27L4Gg+oZ6u/P6 X-Received: by 2002:a63:9843:: with SMTP id l3-v6mr5716110pgo.208.1527163118753; Thu, 24 May 2018 04:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163118; cv=none; d=google.com; s=arc-20160816; b=trMl32V4hSVhzaz28mAjiEDe+bT/iA6Uz937ikYwuAha7PlsQahAnZ7stZji1MldiM Vpnno2LfE0mv5cMU5+xavUpS9Q5Dg5gz1wFYpaTTYKDyRWp4Z3v3L2arnGPSFNwQ00BZ zJZwZWxn3hwzhdNe+Ydd8qz7RoRQNK5oPANdvGD1RASJn1LfBw5TtIbOIe/PMXZ++wve 2Gs7tNw7kk9stiFeyTYWLXaBDybgq0DelzgJtjIB6gikJrG/WZ1GkDIiH76gKQF7KR5p tup9cn+5yK0XYDBtin0HQzZEGDiA5iLduhHsMaVA5T/aynv9KKh7re40LKgkls3FQoyg 1FVg== 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=YlLipN0Yi+DJFH1+JRKIZKaxVPFh+MATdheMJjI7FNo=; b=tGjyTccCzceVRMxPwIiPUkWSvw4gbv4xyjoJgCYE/OWZqyW30MPrcOBAVOWns6ABjt iVv+bYOVC04+Lu1VLllWAJKNXf6ccig4cwMZ7R0cBobBHaO9vD04i9b4vrzQFRrtLgZB psSemjH/S3F/QbFxD0X92M3LcrVhrYiefYhXZrIppozvMmIvvhHLZ5xlvwjdpnLpRazj YHOSwYKmKTGD1qnziDjSoc/diLd3XXYKdAGMBG0MlaLnaFJMEWiQDBhv0aqBQ8Z0ghX9 xScVK/1MGmqAqY8ArOqido4Z6/Iy8IfyKN0KhNRqxvTY70JrHPOyU4+KDkRClcYt6nDa Jflw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QuUsiulJ; 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 f85-v6si20908300pfj.125.2018.05.24.04.58.24; Thu, 24 May 2018 04:58:38 -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=QuUsiulJ; 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 S966795AbeEXJp1 (ORCPT + 99 others); Thu, 24 May 2018 05:45:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966782AbeEXJpY (ORCPT ); Thu, 24 May 2018 05:45:24 -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 E3B7E208D6; Thu, 24 May 2018 09:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155123; bh=ABjpII5+yO4q5RVsezq9ePJlBfAYlDfRRakUc7vCiBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QuUsiulJ1+IRYAR2mIggt3skHr9BAKPyDAydeaWeZMaCE1mcBLja50kOPA5eMj4UG ugplkhv5J0nr3cfytkQ6Ygg+A0eJ0GbhE+bMUL3grA2s4V6kqCe/LO9Wf1EnW/qS7+ +Yl7pkdBhP+nv97P4VEwQQDTKibAvSayjv+4GZ+4= 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.4 63/92] ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr Date: Thu, 24 May 2018 11:38:40 +0200 Message-Id: <20180524093205.395164167@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@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.4-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 @@ -395,7 +396,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; @@ -468,6 +470,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.