Return-Path: Received: from mail-io0-f182.google.com ([209.85.223.182]:35025 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163224AbdKRIU6 (ORCPT ); Sat, 18 Nov 2017 03:20:58 -0500 Received: by mail-io0-f182.google.com with SMTP id i38so11104954iod.2 for ; Sat, 18 Nov 2017 00:20:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <40ad7c6e-f0d7-959a-bf29-d3e3843f5d31@gentoo.org> <23f7da04-95f7-24e7-ee70-ce40c5b8fee3@gentoo.org> <67939ef3-29c6-762c-7afe-46cc69630d95@gentoo.org> <3d948180-6bd7-c4e9-5ac8-5baef9cc15a7@gentoo.org> <09f2480f-e8e8-645b-6d94-b6ae4ca47806@gentoo.org> <242b16cd-056a-1499-2b65-69084dac1d8d@gentoo.org> From: Kees Cook Date: Sat, 18 Nov 2017 00:20:56 -0800 Message-ID: Subject: Re: [nfsd4] potentially hardware breaking regression in 4.14-rc and 4.13.11 To: Linus Torvalds Cc: Patrick McLean , Emese Revfy , Al Viro , Bruce Fields , "Darrick J. Wong" , Linux Kernel Mailing List , Linux NFS Mailing List , stable , Thorsten Leemhuis , "kernel-hardening@lists.openwall.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org List-ID: On Fri, Nov 17, 2017 at 9:29 PM, Linus Torvalds wrote: > On Fri, Nov 17, 2017 at 9:14 PM, Kees Cook wrote: >> >> FWIW, myself doing a build at d9e12200852d with and without >> GCC_PLUGIN_RANDSTRUCT _appears_ to produce identical objdump output >> where I did spot-checks. > > That would probably be a good thing to check anyway - check the > difference between GCC_PLUGIN_RANDSTRUCT on and off at that commit. > > Just do > > objdump --disassemble vmlinux > file > > and compare the two files for where the differences start occurring. Yeah, I was just doing that now. Looks like there _is_ something getting changed just from having the plugin enabled, but it appears localized. For me, the first non-offset change happens in lookup_user_key and persists for a while. -ffffffff813893a7: 0f 85 55 03 00 00 jne ffffffff81389702 -ffffffff813893ad: f0 41 ff 06 lock incl (%r14) -ffffffff813893b1: 83 fb 07 cmp $0x7,%ebx -ffffffff813893b4: 4c 89 b5 70 ff ff ff mov %r14,-0x90(%rbp) ... +ffffffff813893a7: 0f 85 35 03 00 00 jne ffffffff813896e2 +ffffffff813893ad: 4d 89 f0 mov %r14,%r8 +ffffffff813893b0: f0 41 ff 06 lock incl (%r14) +ffffffff813893b4: 83 fb 07 cmp $0x7,%ebx +ffffffff813893b7: 4c 89 b5 70 ff ff ff mov %r14,-0x90(%rbp) And removing the TYPE_ATTRIBUTES() poking makes the register storage differences go away, but there's still a 0x40 byte offset delta. I'll continue looking at this tomorrow. -Kees -- Kees Cook Pixel Security