Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7144995imu; Wed, 14 Nov 2018 12:25:31 -0800 (PST) X-Google-Smtp-Source: AJdET5ehMSr+wuLKYCfaOXJlnwEnLQbKM557kWFgijCWXy7hQz85BMrgDTcid4qGEH2toeN6fwKI X-Received: by 2002:a17:902:780c:: with SMTP id p12mr3276336pll.197.1542227131613; Wed, 14 Nov 2018 12:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542227131; cv=none; d=google.com; s=arc-20160816; b=qLbHhQNls/+4irZn3iq6GNu9cgpFXshNREFpkTz1Z6Hdxgn1C838EnFC83Y9gTaZyk bhtM44Bo0lDMXO9o8EFk+CMYWAvcY5vInvcGjnBqYUZcUSogjAlrt1PGEJ1fAii5qt7K VJ/jvJz+bWZ+6cW6qEItu9fAzZ4AteQKf3d5XItsKVMoDJ3NFOWdABXc88iBm+GX6sc3 WPOM0ysu/xtzogv9O0HAfIP/qhfmaMhKYP16EOtC8Z48Ef1QUVuKyG14vtSNPFxEO6x5 x74tF/ekwU6/7pI6c3/PWYFBmbh+tRzJ3a6DWDEexrbeFvqvCj3WERccHTfF+EgLuATU JS3Q== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=axvV45I2Y10QnsF/P8xjiqH4hRWI3iQzVQHXqRbcFPc=; b=TpTARahKh+LjZUk13CQEwwUpkoW8uUY2Tww5q88Q/lidxlXqpblePvO4Xy/sS/x5wl MfXdXCmNlU7zwGpm0MhmjAJhwF4wVkv5sq6ypdtmxUybQSiwPuwTrMpJpoooA9WGR1xE YdYo0ASViOB8jrfv3nKyOeyZrnygr5jjEJO1BZy2sDmtQoskCiLCBWqynwZ08tU5ax64 4bixkheBXZIWuZY9SdI2KRkGBv5QbSYiSzMolFbYP3549vx1X16deA06G0PdpJl2FRLk rEM0K1Y8lzF9R55eMw4XpQIEKj/VrPiKydPQAMunjJ5ISSLdpcaQT6A8EJgOM5Uh4AXn Gjkg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 204si10307618pfu.273.2018.11.14.12.25.15; Wed, 14 Nov 2018 12:25:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbeKOG3i (ORCPT + 99 others); Thu, 15 Nov 2018 01:29:38 -0500 Received: from mga18.intel.com ([134.134.136.126]:13145 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725757AbeKOG3h (ORCPT ); Thu, 15 Nov 2018 01:29:37 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 12:24:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,233,1539673200"; d="scan'208";a="108104052" Received: from yyu32-desk1.sc.intel.com ([143.183.136.51]) by fmsmga001.fm.intel.com with ESMTP; 14 Nov 2018 12:24:54 -0800 Message-ID: <307b6162b0270871e664ca88a96b4ea0d1b3f65b.camel@intel.com> Subject: Re: [PATCH v5 06/27] x86/cet: Control protection exception handler From: Yu-cheng Yu To: Borislav Petkov Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Date: Wed, 14 Nov 2018 12:19:42 -0800 In-Reply-To: <20181114184436.GK13926@zn.tnic> References: <20181011151523.27101-1-yu-cheng.yu@intel.com> <20181011151523.27101-7-yu-cheng.yu@intel.com> <20181114184436.GK13926@zn.tnic> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-11-14 at 19:44 +0100, Borislav Petkov wrote: > That subject needs a verb: > > Subject: [PATCH v5 06/27] x86/cet: Add control protection exception handler > > On Thu, Oct 11, 2018 at 08:15:02AM -0700, Yu-cheng Yu wrote: > > A control protection exception is triggered when a control flow transfer > > attempt violated shadow stack or indirect branch tracking constraints. > > For example, the return address for a RET instruction differs from the > > safe copy on the shadow stack; or a JMP instruction arrives at a non- > > ENDBR instruction. > > > > The control protection exception handler works in a similar way as the > > general protection fault handler. > > > > Signed-off-by: Yu-cheng Yu > > --- > > arch/x86/entry/entry_64.S | 2 +- > > arch/x86/include/asm/traps.h | 3 ++ > > arch/x86/kernel/idt.c | 4 ++ > > arch/x86/kernel/signal_compat.c | 2 +- > > arch/x86/kernel/traps.c | 64 ++++++++++++++++++++++++++++++ > > include/uapi/asm-generic/siginfo.h | 3 +- > > 6 files changed, 75 insertions(+), 3 deletions(-) > > A *lot* of style problems here. Please use checkpatch and then common > sense to check your patches before sending. All those below are valid, > AFAICT: > > WARNING: function definition argument 'struct pt_regs *' should also have an > identifier name > #76: FILE: arch/x86/include/asm/traps.h:81: > +dotraplinkage void do_control_protection(struct pt_regs *, long); > > WARNING: function definition argument 'long' should also have an identifier > name > #76: FILE: arch/x86/include/asm/traps.h:81: > +dotraplinkage void do_control_protection(struct pt_regs *, long); Yes, I was not sure if the addition should follow the existing style (which does not have identifier names). What do you think is right? Thanks, Yu-cheng