Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5759388ybn; Sun, 29 Sep 2019 05:15:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqysQZHcts8R+FEU5uc3PiIJbxPL2aUsTD98t0Bsj8rJXRkVxQ4JoLVJF6mHvzwDXl/wug4C X-Received: by 2002:a17:906:3281:: with SMTP id 1mr15156932ejw.181.1569759302129; Sun, 29 Sep 2019 05:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569759302; cv=none; d=google.com; s=arc-20160816; b=PIYzRzA8CmW9whB7UGm2CLrzViXND4htgqm+7ZjHBPfq9o78S/K87PeGvHEyukDB7w OcuYgd03X+bYwy/im0llaEdpuRmEbZWp0XPUouZIV1+GrHdp4jL223G/PxARdkKnl+Nf zS0NC+KfVW2gbNJau4L/4JfbY/KGkoOnF/1BIleo/c1fY/A6oPeKEmv8YhqfiP8MxRI0 LC0Nyik1QAIsXHWzB6VFwDx5Ptn9NQBj8nq+/JmT5nlRVo/mRaxr74JGxlpKK2tYIX7Y 2VWu8LfWtwCyEf/+tV+Br/Z3YXcIjfdKb0m20i0xoufJGVFRH+Txt1wPZ/niX9MPTFIh B4UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ReoLOVCaGYO0zDdTc9sz9eU6CfNxDn465zi1yUtPFtk=; b=ExAUcqvGIOr2eDttwaPI2abN0oNTy4nnHSToBse2uCI0ia/EmZaCUpcFYQO+I878tb 0lHJtR+henRWF6PA1otvatUJ0SSYn4F9GScMDIglqu2MNnR21lr8uKmaMbvv6VBFyFLq fJh4ecBIX2RCnnleox/37qpem+PC3XvbzJNU8GdbZVrYlLkmcdjYaTpwDqzObZLMaXux 1cGHtL4fKgO4lkvxzVqfJOVoSWKHvUGoEDlOrsnPHRtAmd2WzzyLbSq47A4z8BuLE6Ol cO0mBevwD9c7Fc1DqIh01F3kiBIjYrX19fv3wv7s8dN3XfjFUe5/A4cf17uMxz5ly1ts 12Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aUiVgCx4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i17si5376497ejc.233.2019.09.29.05.14.14; Sun, 29 Sep 2019 05:15:02 -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=aUiVgCx4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728793AbfI2MMV (ORCPT + 99 others); Sun, 29 Sep 2019 08:12:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34481 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbfI2MMV (ORCPT ); Sun, 29 Sep 2019 08:12:21 -0400 Received: by mail-wm1-f67.google.com with SMTP id y135so11974240wmc.1 for ; Sun, 29 Sep 2019 05:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ReoLOVCaGYO0zDdTc9sz9eU6CfNxDn465zi1yUtPFtk=; b=aUiVgCx4oWw3htW66kLVD7MHD4hILGnAr/lvyQmC5uH9ze5HloeMBBdAJ2JUMQU6/L S1ocHl3BHGTX3l8BWOltI2n+a0LszrpX9z9sUWvv7/YmDtWyA9py7KLvVA94EopJtJJ9 5YLjdtWIVyI/CVy2jtxnpj/85y4jh3kxgeQ7gmuh265S/NDfLywTIdZqmGyAw9f3/07i UnGai12bURYMdOMLb3/WDKOteIM3Vj8Qx8uVr2ZoI6yqOplSe8hOFzDrwf5SeDx49BJ8 sMT1qrlJ1viuWHBg25fV1GaPIOVfXk2CBnDA3pEP4hQtomVIaC8SEavB2S84zoa9L+O/ Numw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ReoLOVCaGYO0zDdTc9sz9eU6CfNxDn465zi1yUtPFtk=; b=gb9W66XK9FYenXoXplAvU/i5u7gRyCmFLhHCugS/zLOGnlha9hCn55+WD3TiJBQaPn nxvhfwmSCOFBb37ne0ny0dcV9PgRyYMEB8RECF85H+tyt22BhaAsd9WIhiDtMpikZrqa Z5k0SgFHGrLPPO3DDa6gpBU/4ZJYfV/gYCRwzY4nlVtmvTSi4oXeayIoG9+jpe0evTKg Yu1MBvi2PBcknwD5BqQPuKHa86X8vHi015jPsKm1jldPmjG8Ok4KFzQSGxOn0jxp6IWE Of+LRB73CukXY5rhnl6PJ4Fm/KGfR813bNGEbmCmEZ+lxvBJfHghlay2IQXg9jx4wDFo fAdQ== X-Gm-Message-State: APjAAAVuae6MO6OQJdBxlqg+srAUfLJc4GON2mvksJdQ4gZuL/TDQ37o cCmhExl280o2rDzYKiXiyno= X-Received: by 2002:a1c:c74e:: with SMTP id x75mr14315738wmf.177.1569759139458; Sun, 29 Sep 2019 05:12:19 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id j26sm17821307wrd.2.2019.09.29.05.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2019 05:12:18 -0700 (PDT) Date: Sun, 29 Sep 2019 14:12:16 +0200 From: Ingo Molnar To: Arvind Sankar Cc: linux-kernel@vger.kernel.org, Randy Dunlap , Andreas Smas Subject: Re: x86/purgatory: undefined symbol __stack_chk_fail Message-ID: <20190929121216.GA35735@gmail.com> References: <20190928211453.GA2300554@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190928211453.GA2300554@rani.riverdale.lan> 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 * Arvind Sankar wrote: > 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 Great, so all known kexec bugs should be fixed for now in Linus's latest kernel, right? Thanks, Ingo