Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1191864imm; Tue, 15 May 2018 15:27:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrwpJjEzUlkMjIjccnaVxTE7LKrKOVU5O8XUwVIMOxJ+YcWATimsVgqe8pCvp7stONYY6cj X-Received: by 2002:a63:2f41:: with SMTP id v62-v6mr13613609pgv.33.1526423266153; Tue, 15 May 2018 15:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526423266; cv=none; d=google.com; s=arc-20160816; b=iFQ1EBgTcoPSleud07vbT7eSV4vzBGCu42Yqt/0ZfJsL+pdbvL5gPLjamKfZLHdbbp 2esi+c6MMNbBavVA22gzkFmDUuqveUTq9AHXcAXz4E9neRF4gSYHWhB6MXr9urLECk/d MrKCYz4Q6jQDlPvgUolYIs+DqhqWBnBULldETRvxKA10Bkdg/F0m/TaiOV7yGAnC3kSu OoDTw3IivjOeVICLrBNaUrprMjuLUUXFi/sKODBaYAIP8JFWI1l7yox0olCqREqzhwji hpJQVMj9GBG2RA2tzOS4SCTZNp0nCW+GDjTiqyoig6dOvejQfNNmfLbfyCCpyrME65qF 4Vig== 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 :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=63TsmBAhT1jl5EQZxiKsAMQiHTxYwcKnBQiU5RklrcE=; b=x24QYStR8bkf5w1e7SmGGB5v9p8v317ddANYZWPmL8oa8/25tQhb6fL7DLTZIHTbE8 pUM3p72mWgAAx7QrmRIseVcaMA//Sz+u5vK/C1f1O+rAJnVHfEfGArEcnY+O867vUwkU s2Dkz9/7MW/oN/3xkjdk+SulacKlqJ0WBhflsj3cFc1DGLKyA3ANDblpMjyMgt/tTvmD TYq1RViOzLC4eLzcksSAjsx0HN2kKQZDMrNGV+6L+AUfDKqIP6mOmQ+O6Txz95crvN5V pHzbs0g3fiz8wrio9NVxL1a2uEMY/9AhUR9SGSMRqkBLhn02doFn31BdTXZ3KYdYBKgZ KUCg== 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 x187-v6si816364pgb.335.2018.05.15.15.27.31; Tue, 15 May 2018 15:27:46 -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 S1752234AbeEOW0J (ORCPT + 99 others); Tue, 15 May 2018 18:26:09 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34022 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeEOW0I (ORCPT ); Tue, 15 May 2018 18:26:08 -0400 Received: from p4fea4eb5.dip0.t-ipconnect.de ([79.234.78.181] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fIiOB-0000fl-54; Wed, 16 May 2018 00:25:47 +0200 Date: Wed, 16 May 2018 00:25:46 +0200 (CEST) From: Thomas Gleixner To: Alexey Dobriyan cc: "Anvin, H Peter" , "Ye, Xiaolong" , Ingo Molnar , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , LKML , "H. Peter Anvin" , "tipbuild@zytor.com" , "lkp@01.org" Subject: Re: [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##] In-Reply-To: <20180515214337.GA18021@avx2> Message-ID: References: <20180515080033.GA7714@yexl-desktop> <20180515210757.GA12225@avx2> <20180515214337.GA18021@avx2> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 May 2018, Alexey Dobriyan wrote: > On Tue, May 15, 2018 at 09:25:53PM +0000, Anvin, H Peter wrote: > > Why is that a problem? > > Code: 00 00 00 eb e6 cc cc cc cc cc cc cc cc cc cc cc cc cc fa 8d b6 00 00 00 00 e8 5d e8 8f ff 8b 44 24 34 83 e0 03 83 f8 03 72 28 cc <cc> cc cc cc cc cc cc fa 8d b6 00 00 00 00 e8 3d e8 8f ff 89 e0 > > > > EIP: ret_from_intr+0xd/0x14 SS:ESP: 0068:8603bfb4 > > > > INT3 slipped through M586 => X86_ALIGNMENT_16 :-\ > > I could make the patch x86_64 only, but! > > It crashed into the middle of the padding. > > 796ef8fc : > 796ef8fc: 8b 44 24 34 mov eax,DWORD PTR [esp+0x34] > 796ef900: 83 e0 03 and eax,0x3 > 796ef903: 83 f8 03 cmp eax,0x3 > 796ef906: 72 28 jb 796ef930 > 796ef908: cc int3 > 796ef909: cc <========> int3 EIP points to the second int3 because that's where a simple return would return to. do_trap() does not handle int3 special. From a quick check that seems to be the only code sequence which has: jcc lbl ENTRY(foo) and ENTRY() aligns to a 16 byte boundary. So the simple fix for that is below. We need objtool support to detect such places ... Thanks, tglx 8<------------------- --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -338,6 +338,11 @@ END(ret_from_fork) cmpl $USER_RPL, %eax jb resume_kernel # not returning to v8086 or userspace + /* + * Jump over the alignment padding which is filled with int3 instructions + */ + jmp resume_userspace + ENTRY(resume_userspace) DISABLE_INTERRUPTS(CLBR_ANY) TRACE_IRQS_OFF