Received: by 10.213.65.68 with SMTP id h4csp1757310imn; Mon, 19 Mar 2018 12:25:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELss2cJGYPqERaa34UDVAry1JV3zsELXY5kxezp1hshzdHVFboXALpg8QUVpqGUfU6XWR281 X-Received: by 2002:a17:902:8a94:: with SMTP id p20-v6mr13764546plo.74.1521487535512; Mon, 19 Mar 2018 12:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521487535; cv=none; d=google.com; s=arc-20160816; b=zokbgQzdnIxUUuaBP2uuJcF7vaQf39zW8ZpVULSLEQEw62fW/laCqAd2oHbAFNBnaA 3525ngMQ/OTQ5bJA2QDccX57gNX+bXDmowFQvRZ/9k7nJglUBVIM5rbaFQkza3m17kGo 7oFGqF5bzqgFKuf3YZy2W7j3efkgIu3oBclvP01epdRTBHDjpzPbR0VlUovET2DAYMDC FNEDpCyjDCiCGVpPY7qSOtkfQSKkSH6bg3G650O3KeCcAqNUVgsaOGznvozf4hJuLkHa jTHYhdw6jZGABIUNp11/vbBRS5dK1SiGKeef6LBcbJbizFY2jgjDfeCmEO4FRLcxxcz/ fuKA== 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 :arc-authentication-results; bh=07srMcpQnXqp/qdQHluKeXOGHdXpxTzSqwGXc6Gsaww=; b=B95XkuSmGiv3adjTHO3zEvr/lHes/33p48SpfaqbJN8tTYgBXCG5VSrhpHeDCBUBh+ quI6qgxnXaomV52gj7FQxZWLGeeD7IlyNdj34ZA0HrX8T5tJlrwYPGlEeYa/kQz3nlUB DAwP2awSIaa20bbj1seSEFDCpg00Av8izzFA+U0AOQrIOaJJTILAKS4ceonAzgWmtkrt 2CI2LIgh/CYk7VnG3qdjbR6+YjabXTkQyZ5rfQP65sEpWXjtGZIzsyXn7jvSRyiuEYkB +GcIzX1twir2E71nh1JHS89Mdj9HPtQfBP/XhgYCfgv26wqzx7b3oYHDsjhIbllEfw0o JqTg== 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 l6si390432pgc.732.2018.03.19.12.25.21; Mon, 19 Mar 2018 12:25:35 -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; 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 S969704AbeCSSYs (ORCPT + 99 others); Mon, 19 Mar 2018 14:24:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967165AbeCSSYl (ORCPT ); Mon, 19 Mar 2018 14:24:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 04E9EF91; Mon, 19 Mar 2018 18:24:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Ananth N Mavinakayanahalli , Andrey Ryabinin , Anil S Keshavamurthy , Borislav Petkov , Brian Gerst , "David S . Miller" , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ye Xiaolong , Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 152/241] kprobes/x86: Fix kprobe-booster not to boost far call instructions Date: Mon, 19 Mar 2018 19:06:57 +0100 Message-Id: <20180319180757.472270630@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu [ Upstream commit bd0b90676c30fe640e7ead919b3e38846ac88ab7 ] Fix the kprobe-booster not to boost far call instruction, because a call may store the address in the single-step execution buffer to the stack, which should be modified after single stepping. Currently, this instruction will be filtered as not boostable in resume_execution(), so this is not a critical issue. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Andrey Ryabinin Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: Brian Gerst Cc: David S . Miller Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ye Xiaolong Link: http://lkml.kernel.org/r/149076340615.22469.14066273186134229909.stgit@devbox Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/kprobes/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -199,6 +199,8 @@ retry: return (opcode != 0x62 && opcode != 0x67); case 0x70: return 0; /* can't boost conditional jump */ + case 0x90: + return opcode != 0x9a; /* can't boost call far */ case 0xc0: /* can't boost software-interruptions */ return (0xc1 < opcode && opcode < 0xcc) || opcode == 0xcf;