Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4543977ybp; Mon, 7 Oct 2019 09:59:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRF00DcU4ATfSH/10bSmyo3be+r/OftlWynj4PwSDVBYXXbIJF/1wHlhHUSN2HqgDqFCFn X-Received: by 2002:a17:906:4ad2:: with SMTP id u18mr25240390ejt.117.1570467594309; Mon, 07 Oct 2019 09:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570467594; cv=none; d=google.com; s=arc-20160816; b=r0Bh38nmrEqbPADY1o3U5y0YcbdAdqTuOn155o92+fYH+yK4vWa+wDEf6OQCy5Pg9L oisWggBxKI5LLLYGLm3NpD+TQEEypkS2LkfTwtovX/RDzAo4tQSGKu3lxVGqAyc54QVo hIwJh3HQ63/bXPc/7Da6OeMzHak9hbAqLMDYuXRwsMxA0rvf1TKByEvF//bUo+zpVT4+ /Jc9d60I/hAwkgyDOSEbrQcJKHKNflsFn1iLVq8N5+UvvXl/Rj0hJYSgpWki8qSUm/Mf 4Jf+Nud8Qf9//rZapS2dAwZgt7jW19Xf+g8mAqn5vf9veajEFN0PdJJgo+F8OioFNIYQ AKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Ds6pyGFUgAlo48+0gNzJE98Ix35K9s00JTvg/dMmXpk=; b=gevvcrRUdGL6JQ434Ta57BdAlH75/r9Fncs3L4uW26K51PEAl2/iiWflnzQ1HgnTTz WGdLIrDL0xDLhZsU5+OkijwJif8F9darVgvty5rFo9AerFNikFy2/JzU2hkG8yZFcpVY z4Q6gdYf2/KpwsivBepN8PCbyB/0VDk1IbcnZ7CUOcMUDCmgSSl8TYdVbKJ/nVxDuY2X QmHp/WAMi1KQC2aCXso24eyphq0r8Ysouuhln20JZ7uh2vutSF4vNZfa4XCVvsF13Ib/ Ri9u5AcUCCu1crv+qrzyDP0v73Ic5MNjAX+zg2SdegXwF89eVtZqEkkx9AxfkGpg4rp4 vyJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lg9PCB+U; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si8086578edn.267.2019.10.07.09.59.30; Mon, 07 Oct 2019 09:59:54 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lg9PCB+U; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728806AbfJGQ5C (ORCPT + 99 others); Mon, 7 Oct 2019 12:57:02 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:55112 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727935AbfJGQ5C (ORCPT ); Mon, 7 Oct 2019 12:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570467420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ds6pyGFUgAlo48+0gNzJE98Ix35K9s00JTvg/dMmXpk=; b=Lg9PCB+UuKMRGR1/tIz/qyFn6/OGB7LddGnEDQ5+VTazjurP/bOtw7afUOU2eoE36Yv5Lu phPruF75IL3+l3Y5HqhAxVP6SI5urjXrT6KlmeSXJcWuViGsLTfy1rKORu/0yz4m/aSYI+ DXWvvsmep/DtdtjzIaF1Km0Y/boe9DU= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-CQtL6-aaNvO_3W3XPS_59w-1; Mon, 07 Oct 2019 12:56:56 -0400 Received: by mail-ed1-f71.google.com with SMTP id o92so9405116edb.9 for ; Mon, 07 Oct 2019 09:56:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=P1CSWLKvlWejbOftg/y2xVMNmqQ4hHOqwQAeyYB2Yp4=; b=jJ1bUgCoTfnJZQomD0tFYDsG2JHOSOs1TXIRakbUyn1b0InOZ1Fc2wM8Xk6U9Pg5UO JYJvtjBCa+/R6eeTU5MQ2nOzsjJBhrPnDmFodsAiKODL/SimL0R6GbqeRBk2ryFuKTZB uSulgtLr7I9PcVQsytjEzqw2z34WGSHxb+Uj5al5gu2w1ZwilKgjIG1S65tobqhXuwGw lk3CAfHrd/HOPX0TlOZfkzZOZZx762A1b3ut8/gc+4Asjrumdu0egDroRqNdOOog6FLv R7U3DT4NDoS00IRM/xm/nuNex27iHIPVqOP1Vp8RwiM9dBnv1yFD6PAkUtfB5N3FbXXw V3rw== X-Gm-Message-State: APjAAAWKMEHcWfGmcPDnK+Eiy+DZFi2EiXdhUzO5Ukcjpsf2sSFm4jNN PS7sIHxHXtB/axlaZdH+KIkqOe1i7Jvo00Ruu48IuzYxxKYbIMQBqMvj+Kt7CaVEy4xQAq3GbFE pGmIAgG+ZrmCpOds6ef+Xrgc1 X-Received: by 2002:a17:906:768f:: with SMTP id o15mr24985414ejm.42.1570467414799; Mon, 07 Oct 2019 09:56:54 -0700 (PDT) X-Received: by 2002:a17:906:768f:: with SMTP id o15mr24985404ejm.42.1570467414588; Mon, 07 Oct 2019 09:56:54 -0700 (PDT) Received: from shalem.localdomain (2001-1c00-0c14-2800-ec23-a060-24d5-2453.cable.dynamic.v6.ziggo.nl. [2001:1c00:c14:2800:ec23:a060:24d5:2453]) by smtp.gmail.com with ESMTPSA id bo6sm1882177ejb.30.2019.10.07.09.56.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 09:56:53 -0700 (PDT) Subject: Re: kexec breaks with 5.4 due to memzero_explicit To: Arvind Sankar Cc: linux-kernel@vger.kernel.org, Ingo Molnar , x86@kernel.org References: <20191007030939.GB5270@rani.riverdale.lan> <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> <0f083019-61e8-7ed5-dde7-99e1aa363d9c@redhat.com> <20191007132005.GB269842@rani.riverdale.lan> From: Hans de Goede Message-ID: Date: Mon, 7 Oct 2019 18:56:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191007132005.GB269842@rani.riverdale.lan> Content-Language: en-US X-MC-Unique: CQtL6-aaNvO_3W3XPS_59w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 07-10-2019 15:20, Arvind Sankar wrote: > On Mon, Oct 07, 2019 at 11:10:18AM +0200, Hans de Goede wrote: >> Hi, >> >> On 07-10-2019 10:50, Hans de Goede wrote: >>> Hi, >>> >>> On 07-10-2019 05:09, Arvind Sankar wrote: >>>> Hi, arch/x86/purgatory/purgatory.ro has an undefined symbol >>>> memzero_explicit. This has come from commit 906a4bb97f5d ("crypto: >>>> sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit") >>>> according to git bisect. >>> >>> Hmm, it (obviously) does build for me and using kexec still also works >>> for me. >>> >>> But it seems that you are right and that this should not build, weird. >> >> Ok, I understand now, it seems that the kernel will happily build with >> undefined symbols in the purgatory and my kexec testing did not hit >> the sha256 check path (*) so it did not crash. I can reproduce this befo= re my patch: >=20 > Yes -- this should really be fixed. purgatory build should fail if there > are undefined symbols, in fact the Makefile apparently is trying to do > something to catch undefined references? >=20 > LDFLAGS_purgatory.ro :=3D -e purgatory_start -r --no-undefined -nostdlib = -z nodefaultlib >=20 > This doesn't seem to actually do anything though. Anyone know of a way > to force ld to error if the resulting object would have undefined > symbols? I've figured out a way to get an error for the missing symbol, I will Cc you on the patch which I will post upstream soon. I will also write a similar patch for s390 and post that upstream (untested) separately. Regards, Hans