From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755847AbbCPWUp (ORCPT ); Mon, 16 Mar 2015 18:20:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46465 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753280AbbCPWUm (ORCPT ); Mon, 16 Mar 2015 18:20:42 -0400 Message-ID: <55075736.7030003@redhat.com> Date: Mon, 16 Mar 2015 23:20:38 +0100 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Borislav Petkov CC: linux-tip-commits@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, ast@plumgrid.com, fweisbec@gmail.com, oleg@redhat.com, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, mingo@kernel.org, wad@chromium.org, rostedt@goodmis.org Subject: Re: [tip:x86/asm] x86/asm/entry/64: Remove unused thread_struct::usersp References: <1425984307-2143-2-git-send-email-dvlasenk@redhat.com> <20150316164707.GB23015@pd.tnic> In-Reply-To: <20150316164707.GB23015@pd.tnic> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/16/2015 05:47 PM, Borislav Petkov wrote: > On Mon, Mar 16, 2015 at 05:05:53AM -0700, tip-bot for Denys Vlasenko wrote: >> Commit-ID: 245214a155c711764b3853189441c9f8aeb058b3 >> Gitweb: http://git.kernel.org/tip/245214a155c711764b3853189441c9f8aeb058b3 >> Author: Denys Vlasenko >> AuthorDate: Tue, 10 Mar 2015 11:45:07 +0100 >> Committer: Ingo Molnar >> CommitDate: Tue, 10 Mar 2015 13:56:11 +0100 >> >> x86/asm/entry/64: Remove unused thread_struct::usersp >> >> All manipulations of PER_CPU(old_rsp) in C code are removed: >> it is not used on SYSRET return, so storing anything there is >> pointless. >> >> This also allows us to get rid of thread_struct::usersp, >> which was needed only to set PER_CPU(old_rsp) for correct >> return from fork/clone. >> >> Tweak a few comments as well: we no longer have "partial stack frame", >> ever. >> >> Signed-off-by: Denys Vlasenko >> Cc: Alexei Starovoitov >> Cc: Borislav Petkov >> Cc: Frederic Weisbecker >> Cc: H. Peter Anvin >> Cc: Kees Cook >> Cc: Linus Torvalds >> Cc: Oleg Nesterov >> Cc: Steven Rostedt >> Cc: Will Drewry >> Link: http://lkml.kernel.org/r/1425984307-2143-2-git-send-email-dvlasenk@redhat.com >> Signed-off-by: Ingo Molnar > > So this patch is causing all kinds of segfaults when booting my kvm > guest here, see below. I built defconfig kernel from tip, and tested it again under qemu-kvm. Works for me with and without this change. What's your config? What distro do you run in the guest? > Reverting it makes the segfaults go away but from looking at the patch, > I have no idea why it would even cause those segfaults. Yep. This is one of those cases where "it must be completely safe"... > [ 5.285547] kmod[1316]: segfault at 738c08 ip 0000000000738c08 sp 00007ffdb6079c68 error 15 > [ 9.537606] tput[2716]: segfault at 0 ip (null) sp 00007fffffffdbd0 error 14 in tput[400000+3000] > ^^^^^^^^^^^^^^^^^ > > Looks like rIP has went off somewhere in the weeds. > Hmmm... > > [ 4.593374] grep[998]: segfault at 7ffc3a9f4378 ip 00007fb8409fe1df sp 00007ffc3a9f4378 error 4 in ld-2.13.so[7fb8409e8000+20000] > [ 4.593374] grep[998]: segfault at 7ffc3a9f4378 ip 00007fb8409fe1df sp 00007ffc3a9f4378 error 4 in ld-2.13.so[7fb8409e8000+20000] > > [ 7.160423] sed[1999]: segfault at 7ffe9998f778 ip 00007f37deef0b52 sp 00007ffe9998f778 error 4 in libc-2.13.so[7f37dee18000+182000] > > [ 4.593374] grep[998]: segfault at 7ffc3a9f4378 ip 00007fb8409fe1df sp 00007ffc3a9f4378 error 4 in ld-2.13.so[7fb8409e8000+20000] > [ 7.160423] sed[1999]: segfault at 7ffe9998f778 ip 00007f37deef0b52 sp 00007ffe9998f778 error 4 in libc-2.13.so[7f37dee18000+182000] > > [ 4.593374] grep[998]: segfault at 7ffc3a9f4378 ip 00007fb8409fe1df sp 00007ffc3a9f4378 error 4 in ld-2.13.so[7fb8409e8000+20000] > [ 7.160423] sed[1999]: segfault at 7ffe9998f778 ip 00007f37deef0b52 sp 00007ffe9998f778 error 4 in libc-2.13.so[7f37dee18000+182000] > [ 5.607611] sed[1350]: segfault at 7ffddd4a4bf0 ip 00007ff24a11fafc sp 00007ffddd4a4bf0 error 4 in libc-2.13.so[7ff24a050000+182000] This does not look entirely random. Can you take a look what's at those locations in ld-2.13.so and libc-2.13.so?