From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbbLIGWT (ORCPT ); Wed, 9 Dec 2015 01:22:19 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:32835 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbbLIGWO (ORCPT ); Wed, 9 Dec 2015 01:22:14 -0500 MIME-Version: 1.0 In-Reply-To: References: <2ff015fa6989c6a8907c73636f5f5cb99402f6c3.1449522077.git.luto@kernel.org> From: Andy Lutomirski Date: Tue, 8 Dec 2015 22:21:54 -0800 Message-ID: Subject: Re: [PATCH 07/12] x86/entry/64: Always run ptregs-using syscalls on the slow path To: Brian Gerst Cc: Andy Lutomirski , "the arch/x86 maintainers" , Linux Kernel Mailing List , Borislav Petkov , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Denys Vlasenko , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 8, 2015 at 9:45 PM, Andy Lutomirski wrote: > On Tue, Dec 8, 2015 at 8:43 PM, Brian Gerst wrote: >> On Mon, Dec 7, 2015 at 4:51 PM, Andy Lutomirski wrote: >>> 64-bit syscalls currently have an optimization in which they are >>> called with partial pt_regs. A small handful require full pt_regs. >>> >>> In the 32-bit and compat cases, I cleaned this up by forcing full >>> pt_regs for all syscalls. The performance hit doesn't really matter. >>> >>> I want to clean up the 64-bit case as well, but I don't want to hurt >>> fast path performance. To do that, I want to force the syscalls >>> that use pt_regs onto the slow path. This will enable us to make >>> slow path syscalls be real ABI-compliant C functions. >>> >>> Use the new syscall entry qualification machinery for this. >>> stub_clone is now stub_clone/ptregs. >>> >>> The next patch will eliminate the stubs, and we'll just have >>> sys_clone/ptregs. >>> >>> Signed-off-by: Andy Lutomirski >> >> Fails to boot, bisected to this patch: >> [ 32.675319] kernel BUG at kernel/auditsc.c:1504! >> [ 32.675325] invalid opcode: 0000 [#65] SMP >> [ 32.675328] Modules linked in: >> [ 32.675333] CPU: 1 PID: 216 Comm: systemd-cgroups Tainted: G D >> 4.3.0-rc4+ #7 >> [ 32.675336] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 >> [ 32.675339] task: ffff880000075340 ti: ffff880036520000 task.ti: >> ffff880036520000 >> [ 32.675350] RIP: 0010:[] [] >> __audit_syscall_entry+0xcd/0xf0 >> [ 32.675353] RSP: 0018:ffff880036523ef0 EFLAGS: 00010202 >> [ 32.675355] RAX: 000000000000000c RBX: ffff8800797b3000 RCX: 00007ffef8504e88 >> [ 32.675357] RDX: 000056172f37cfd0 RSI: 0000000000000000 RDI: 000000000000000c >> [ 32.675359] RBP: ffff880036523f00 R08: 0000000000000001 R09: ffff880000075340 >> [ 32.675361] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 >> [ 32.675363] R13: 00000000c000003e R14: 0000000000000001 R15: 0000000000001000 >> [ 32.675380] FS: 00007f02b4ff48c0(0000) GS:ffff88007fc80000(0000) >> knlGS:0000000000000000 >> [ 32.675383] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b >> [ 32.675385] CR2: 00007f93d47ea0e0 CR3: 0000000036aa9000 CR4: 00000000000006e0 >> [ 32.675391] Stack: >> [ 32.675396] ffff880036523f58 0000000000000000 ffff880036523f10 >> ffffffff8100321b >> [ 32.675401] ffff880036523f48 ffffffff81003ad0 000056172f374040 >> 00007f93d45c9990 >> [ 32.675404] 0000000000000001 0000000000000001 0000000000001000 >> 000000000000000a >> [ 32.675405] Call Trace: >> [ 32.675414] [] do_audit_syscall_entry+0x4b/0x70 >> [ 32.675420] [] syscall_trace_enter_phase2+0x110/0x1d0 >> [ 32.675425] [] tracesys+0x3a/0x96 >> [ 32.675464] Code: 00 00 00 00 e8 a5 e0 fc ff c7 43 04 01 00 00 00 >> 48 89 43 18 48 89 53 20 44 89 63 0c c7 83 94 02 00 00 00 00 00 00 5b >> 41 5c 5d c3 <0f> 0b 48 c7 43 50 00 00 00 00 48 c7 c2 60 b4 c5 81 48 89 >> de 4c >> [ 32.675469] RIP [] __audit_syscall_entry+0xcd/0xf0 >> [ 32.675471] RSP > > I'm not reproducing this, even with audit manually enabled. Can you > send a .config? Never mind, I found the bug by inspection. I'll send a fixed up series tomorrow. Can you send the boot failure you got with the full series applied, though? I think that the bug I found is only triggerable part-way through the series -- I think I inadvertently fixed it later on. --Andy