Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4313247ybp; Mon, 7 Oct 2019 06:41:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVaZDA7wR574r72HJKhEAjamHGOJIZMOPvTYBls13CVcpMdj8hOsZtOvnLQ0Vx7dxAIw5v X-Received: by 2002:a50:eac4:: with SMTP id u4mr29377511edp.36.1570455715149; Mon, 07 Oct 2019 06:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570455715; cv=none; d=google.com; s=arc-20160816; b=vWEr7zLmWK7/fUgnaahxJ5TLDwriPhkLluoM/d5YVBpbNI1snz0AaBb2rtq/CItwyA qlgoKPGBNah6WDlyv9noHOIeugiVestRbX8UlRxg+D5RwgGOoKd5BsjTJJfvpIgF12Ee KIJro1FNumc6tvHoAtyVJjBxHIDXO4kk8uIbwU/HrZtEZUfxK4zti13UnDYUZbvTXpZd Ep7TVREElByL+YYMKtn4+i4PYaw/1isr7Ydhq2PX/V7EhKLf2nv+g7XpQ+CXQt6nptVO BgtWz87G4r+Uw+PCd4HWvvgpwNzqCvgLXmtcm1rR1ZYXxsCpjZFIfIltvnPXgTd/ShDd eHhQ== 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=fX/zCON3jac9NXSSdIrhRtFdIBVCQNgDQg3GIFKl4R4=; b=l9YCDiCpvUf3eXMue6JwhC1zzyjrDuRYQZvOdPZu8Ni9fYpWqHmSiQD6nhnIifyvE4 RWaEIVBrn4En7uwIO5dSU7UTId6rFAK3mUqUDwGNiMi0jdCGIi1k8sdNTO0rehCIs0Mp 5R17fcfWO2xUjCXscDjymSgj0mXku3q2++nA8TRYd3HLnu0SbeE4lLk+CI1yalB00Av4 ofaXA7NcwTBC+rq0HDRobWcqJzAb/rB/OgRpQ5EYg3owL0iAxFeVw2fE34HIc61DStLl oU3rZqa+fsnh3tJuQ0OpSHQjw7Ax+pLccwsSEhurw861fMYFrkXvHn0+s6MmpIcTKtu+ 5Rhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Mr8Uhvk9; 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 pk19si7110726ejb.257.2019.10.07.06.41.31; Mon, 07 Oct 2019 06:41:55 -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=Mr8Uhvk9; 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 S1727958AbfJGNlG (ORCPT + 99 others); Mon, 7 Oct 2019 09:41:06 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35938 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726334AbfJGNlF (ORCPT ); Mon, 7 Oct 2019 09:41:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570455664; 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=fX/zCON3jac9NXSSdIrhRtFdIBVCQNgDQg3GIFKl4R4=; b=Mr8Uhvk9SitbQuTxfYiLYzCnpoljM4B2TA9ISGmNOsuM+Y2+mnGzb5ugzMBr5aNzeELH29 gUh6neskhT6AsnmFmtauJ9+TtBh77zKQo/ekcvMBRmAJQZDfdFEtVU5dqZOUC3lSwvnDB7 +80/vaj5CRh3DyGzzWB0jesDAxDOFRU= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-217-B9wjmCXEMSKcyESt7q1-ew-1; Mon, 07 Oct 2019 09:40:59 -0400 Received: by mail-ed1-f70.google.com with SMTP id 34so9047589edf.0 for ; Mon, 07 Oct 2019 06:40:59 -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=6BIubpxJ0QU0S7koZZBlDHe4I0HSpCMQNSMgJFFjz8o=; b=OcQqAvHV0BpnbfJ9yFUqAfKE0wmWusxF6xHxTDmUE+CwBDli+bpyE4MBxedBBbXNOT eJvkj+/fUGVr8JwUEth/+/3ps0myKdd0aRhKu1+GL00fhSlX5ySS881u5GTzcppFMdk1 yTDGGNg5TsmsRZWmaVe8y52anRv9fjRNZZM+5YJqeEUJ0M4veI1FAlnpXXo9NVcAADMK t8kIMUgeir/21wqv7wPctxdfm13JWLPjFR4GcE5gWZdTpefPNv9ZduTTw0O8RzN44oIK ZXenvV8gkJmA6ar6LtMZKxWfzRBWLVhLWdPiSSqBcyyBHNUKWa8o5lBZN3zMwCztS3hJ Ik3Q== X-Gm-Message-State: APjAAAWa1MUl2eTBLsPNf04q4hU7CsRoEBZPHNb8SDfKOWkksh3HtoS2 tKIVfSh4/bGJjAFaNmqZkrc+vaOfo5av/JSJC6F6ObmbktfZ295LnugxCAsP1XyoiaukSebNwha hD/39s4CZI05fECTQUr74e6OX X-Received: by 2002:a17:906:4541:: with SMTP id s1mr24149660ejq.210.1570455658055; Mon, 07 Oct 2019 06:40:58 -0700 (PDT) X-Received: by 2002:a17:906:4541:: with SMTP id s1mr24149645ejq.210.1570455657850; Mon, 07 Oct 2019 06:40:57 -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 o22sm3232501edv.26.2019.10.07.06.40.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 06:40:57 -0700 (PDT) Subject: Re: kexec breaks with 5.4 due to memzero_explicit To: Ingo Molnar Cc: Arvind Sankar , linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov , Thomas Gleixner References: <20191007030939.GB5270@rani.riverdale.lan> <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> <0f083019-61e8-7ed5-dde7-99e1aa363d9c@redhat.com> <20191007130942.GA82950@gmail.com> From: Hans de Goede Message-ID: Date: Mon, 7 Oct 2019 15:40:56 +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: <20191007130942.GA82950@gmail.com> Content-Language: en-US X-MC-Unique: B9wjmCXEMSKcyESt7q1-ew-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:09, Ingo Molnar wrote: >=20 > * Hans de Goede wrote: >=20 >> 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: >> >> [hans@shalem linux]$ ld arch/x86/purgatory/purgatory.ro >> ld: warning: cannot find entry symbol _start; defaulting to 000000000040= 1000 >> ld: arch/x86/purgatory/purgatory.ro: in function `sha256_transform': >> sha256.c:(.text+0x1c0c): undefined reference to `memzero_explicit' >=20 > I've applied your fix, Thank you, unfortunately I was just minutes away from sending a v2 which adds a missing barrier call (not strictly necessary, more future proofing). Hopefully you can still pick up v2 instead, let me know if you want an incremental patch instead. Regards, Hans