Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5138238ybn; Sat, 28 Sep 2019 14:16:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtszEYuShMSLtA9vFbbI3+mfJvgSb9x/+LnvNQEE7mjB6KK1TgI0of5jDlJpdYW8eJQw7w X-Received: by 2002:a50:ab84:: with SMTP id u4mr11804579edc.13.1569705375206; Sat, 28 Sep 2019 14:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569705375; cv=none; d=google.com; s=arc-20160816; b=cn0bXBlMKxm9NN+ZxFJhc8rM39aF8HOddFkQXtlg8j5NFGW2y7QckAi474zfGd2zfO 2wNCV0KIXSJcQy2l4mGUEORIhyjmHT4EHGX9fsLTjzDZ4P+jNgpnFFQjJv3+EAw1VbRE NKFKZTz9p6VGJWdFtoo0W9wxaSeyKzq4v8+nsa9ZRGvYshEnq79aIhptixYHZIApFrzC btGdvgtOZBAAERcADn9vXSsygzYxLw7kn5pfMck3AzwRcC9HceE8C00ZVEjUzOhtMECg ClXbXhoztuYk8EH0/coJX9HdS9XpcFjeABok97SD1ufIpmcFqn3N1SB3iC6KnZOM6LBP gAiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:date:from:dkim-signature; bh=0P2GLR5OwtTpxgCDK5Jv/YpV62Rd2/0hL9aWprfsTbE=; b=gC+pXRTfi7z8NMAUpgawamzHaMED8fDVeJY+Adk41rwz0nX3bKvDtH9DHbOwFiy9CB bQJIimV0CWZE8+vwteV+NJIqCGUMOOnHqjCy/K10ri11NTB10JSNoMiUukQt7zfO6+uT 7jVSUV98/ten7qgkN9xo4G4V3PfUzw3ULqbXzYviL4hzEWu+LNulZnEm9QLuQaccuDTA GAB1FMzIOv9uDP7XMSu9f2isTkWQ8Qb17uVKGhUiqUOnFS5fWFU9O/bQki3AtzSVcMPw A3d3iBgwdtXLGVcGCquT9K4hNb6BEOOubf6GqpHckW9WM9lFCxfhauNYrPUxeO74Hjqu K0zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="JxNru4/H"; 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 t37si4808115edd.25.2019.09.28.14.15.50; Sat, 28 Sep 2019 14:16:15 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="JxNru4/H"; 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 S1728768AbfI1VO7 (ORCPT + 99 others); Sat, 28 Sep 2019 17:14:59 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41363 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728569AbfI1VO6 (ORCPT ); Sat, 28 Sep 2019 17:14:58 -0400 Received: by mail-qt1-f196.google.com with SMTP id n1so11873086qtp.8 for ; Sat, 28 Sep 2019 14:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=0P2GLR5OwtTpxgCDK5Jv/YpV62Rd2/0hL9aWprfsTbE=; b=JxNru4/HpIbgU77KyIsMwYKhI7Rk9WTyEQhMLNvoXaR2Ds0RbXEZfFS97IBxe8vKMt DUc6YsDCsNJP/Pey/wgKIPhv5cjfASGQvj12LbpMte/5lT6gBuXgTsgnyx3m3Bm+3bBk tEcs4617kXKCFA3mGK3JQ77PvIJ5TlUbqgcPk5uRsaQICwsKfQ4aBFiq1j0Jt9+/ir1N Lndu2HPiH/iG4aSgLAbr/nkLJZXeeE4xHKOB6vtMvoK14UovliIWvg/W8xAU0/mz6s5g FlamfLZoPoUGwruznUiWRbCnk+IMWrOCRW5RGuEOhU4iVlftMa4ALaZVylVkpHTqWHOk n7FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :mime-version:content-disposition:user-agent; bh=0P2GLR5OwtTpxgCDK5Jv/YpV62Rd2/0hL9aWprfsTbE=; b=W6bU5b0KHWgSM4g4gaa+2f8Zm+ZYkTu5iB9I+wDoTD1sB1QCWVJlcL7A0Qk3fWV49E hLgG8B+lmQ8dbIFdak0borqpobRKaOUA45BpkdIwjp/lPhXt08WAD4YbCUthCPV7LaDb KwcKL/b/KU5ThgztoAGvwzlilyOo/jI0tN43f4EB5aMGHFd05nzUu+PwLzQD2Bka+hDJ 9XAi/xteh7XXYgd7O6xNMhYzZYYzhC4v45nIrzdVAye5Zb/TxMW2cxxoD4PGrAHyeb/b OArgGcYcAyHIYF+vhfGp7cWjHCR3o7OcpJm8juvfnnNhX9hO3CN9/7LtIgchSRT1cr1l xkBA== X-Gm-Message-State: APjAAAV0J9OdjOfl9QwceG0AxU7c5okl7z8RqgXhvSSP2s2pn0IXs02x GE9FWUk1aYRUqbmpN49ATfg= X-Received: by 2002:aed:3f3a:: with SMTP id p55mr18283755qtf.148.1569705297722; Sat, 28 Sep 2019 14:14:57 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id e4sm2954890qkl.135.2019.09.28.14.14.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Sep 2019 14:14:57 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sat, 28 Sep 2019 17:14:55 -0400 To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Randy Dunlap , Andreas Smas Subject: Re: x86/purgatory: undefined symbol __stack_chk_fail Message-ID: <20190928211453.GA2300554@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 28, 2019 at 12:41:29PM +0000, Ingo Molnar wrote: > > * Randy Dunlap wrote: > > > On 9/3/19 8:50 AM, Andreas Smas wrote: > > > Hi, > > > > > > For me, kernels built including this commit > > > b059f801a937 (x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS) > > > > > > results in kexec() failing to load the kernel: > > > > > > kexec: Undefined symbol: __stack_chk_fail > > > kexec-bzImage64: Loading purgatory failed > > > > > > Can be seen: > > > > > > $ readelf -a arch/x86/purgatory/purgatory.ro | grep UND > > > 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND > > > 51: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail > > > > > > Using: gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) > > > > > > Adding -ffreestanding or -fno-stack-protector to ccflags-y in > > > arch/x86/purgatory/Makefile > > > fixes the problem. Not sure which would be preferred. > > > > > > > Hi, > > Do you have a kernel .config file that causes this? > > I can't seem to reproduce it. > > Does it go away with this fix in x86/urgent: > > ca14c996afe7: ("x86/purgatory: Disable the stackleak GCC plugin for the purgatory") > > git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/urgent > > ? > > Thanks, > > Ing This one was fixed by [1] e16c2983fba0f ("x86/purgatory: Change compiler flags from -mcmodel=kernel to -mcmodel=large to fix kexec relocation errors") from Steve Wahl, which in addition to changing mcmodel also added back -ffreestanding (and -fno-zero-initialized-in-bss). It was merged on the 12th. The stackleak one is a different undefined symbol error. [1] https://marc.info/?l=git-commits-head&m=156829711224800