Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3645347imm; Mon, 18 Jun 2018 01:28:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKmAj1nXR6TsohpVyta/7zc+IEXk/Kte2LLH2iB3HDQBeLFc/pC1GWmqXXVbj3FqzKZQkmL X-Received: by 2002:a63:b215:: with SMTP id x21-v6mr10093822pge.393.1529310492401; Mon, 18 Jun 2018 01:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529310492; cv=none; d=google.com; s=arc-20160816; b=K8+Duf9Ud/1lIyVjhry5MKoPJYGSfKCtaEvD7Qi8NY+bIAb9xLl0/kEKtay8rSNCf7 Q6nJTSwLSMfnvTuXEppoYLRjzOIhoLAYIXECNg0LzIUHBIH12D/auyh0YoHRPj7Hy1bj yvdumh5Dxx06NAigD83RqpczOEZctsfvj5YJlmflYXU1EFM+GYEXzHn25ZmlCH2r8yoY +r4wmrf2DSh8ZCZ31RnBpfOkdtQG8E8WUVsoPwBEAJOckjOg3MXQf5O9ay8A8r87u3/D bPZYiUPa+SUJFze2r28FVLLqVZEqafgkVvXBX+fJ4Yeo3tL6IOIl6/L7HFt5m3EU3ZBe dE6Q== 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=3bes/m5NvyHi7qX5JYQ0s0alXfGMZf3USO0YKgOduas=; b=P+o0P8GoPkgd2erEQ7gVGWLebsSoUjCEIK3LrQfWAfTJ6QHhxjGSFVOMCx5g9uYSzV nULYteOklG+cfT69xBAen8YgjKhXz/hbDR/1+1NJU2wvXsaJ1KjcsDsWw8otN4Cru7ud nJJKINGq8GHYfMHLO686rnw4OWve4Bc99NuK1DOPT37PkqhAfZALyDvgDL9bQRd0zQco Uz4D+pLvJhjtKEIwyekLtjeL+vWr2Iqh65I0fMzf2widZ3WFlIQGjpMbMw6e4ESczwEy bkA51Vve8kl/xfkXsMpAJqiuHTmPLMWdx9+Y0C2RjVSpWrRIBR4hnoFKLYTcKcnOjoT8 ocjA== 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 f6-v6si11668209pgc.73.2018.06.18.01.27.58; Mon, 18 Jun 2018 01:28:12 -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 S966134AbeFRI0U (ORCPT + 99 others); Mon, 18 Jun 2018 04:26:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57222 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966044AbeFRI0O (ORCPT ); Mon, 18 Jun 2018 04:26:14 -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 690BBC9D; Mon, 18 Jun 2018 08:26:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Zijlstra , Josh Poimboeuf , Masami Hiramatsu , Thomas Gleixner , Ricardo Neri , Francis Deslauriers , Oleg Nesterov , Alexei Starovoitov , Steven Rostedt , Andy Lutomirski , "H . Peter Anvin" , Yonghong Song , Borislav Petkov , Linus Torvalds , "David S . Miller" , Ingo Molnar , Sasha Levin Subject: [PATCH 4.16 233/279] objtool, kprobes/x86: Sync the latest header with tools/objtool/arch/x86/include/asm/insn.h Date: Mon, 18 Jun 2018 10:13:38 +0200 Message-Id: <20180618080618.457548198@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@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: Ingo Molnar [ Upstream commit 4fe875e4bd3cae85ae6f6eaf77f63fabe613b66e ] The following commit: ee6a7354a362: kprobes/x86: Prohibit probing on exception masking instructions Modified , adding the insn_masking_exception() function. Sync the tooling version of the header to it, to fix this warning: Warning: synced file at 'tools/objtool/arch/x86/include/asm/insn.h' differs from latest kernel version at 'arch/x86/include/asm/insn.h' Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: Masami Hiramatsu Cc: Thomas Gleixner Cc: Ricardo Neri Cc: Francis Deslauriers Cc: Oleg Nesterov Cc: Alexei Starovoitov Cc: Steven Rostedt Cc: Andy Lutomirski Cc: "H . Peter Anvin" Cc: Yonghong Song Cc: Borislav Petkov Cc: Linus Torvalds Cc: "David S . Miller" Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/objtool/arch/x86/include/asm/insn.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- a/tools/objtool/arch/x86/include/asm/insn.h +++ b/tools/objtool/arch/x86/include/asm/insn.h @@ -208,4 +208,22 @@ static inline int insn_offset_immediate( return insn_offset_displacement(insn) + insn->displacement.nbytes; } +#define POP_SS_OPCODE 0x1f +#define MOV_SREG_OPCODE 0x8e + +/* + * Intel SDM Vol.3A 6.8.3 states; + * "Any single-step trap that would be delivered following the MOV to SS + * instruction or POP to SS instruction (because EFLAGS.TF is 1) is + * suppressed." + * This function returns true if @insn is MOV SS or POP SS. On these + * instructions, single stepping is suppressed. + */ +static inline int insn_masking_exception(struct insn *insn) +{ + return insn->opcode.bytes[0] == POP_SS_OPCODE || + (insn->opcode.bytes[0] == MOV_SREG_OPCODE && + X86_MODRM_REG(insn->modrm.bytes[0]) == 2); +} + #endif /* _ASM_X86_INSN_H */