Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4043109ybp; Mon, 7 Oct 2019 02:12:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqywlHrITeVPBxZHXyArzWvx84bhAySmwSsEdacgiYhCpVoOW8Sq0lVipis4eY4aHHJkv8Y7 X-Received: by 2002:a50:91b1:: with SMTP id g46mr27290347eda.255.1570439574666; Mon, 07 Oct 2019 02:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570439574; cv=none; d=google.com; s=arc-20160816; b=Pn0CZ4VsRfUXCYbY1JYm7vqiHJ8Fqp4OC7TNCzH52wGTsENjhIDdDN6lqbuI/kfrPz 67OWIzy1qDl14wZ1VHl2UHgtsRMzZOFo/wKgGBJUoikVM7+0gEVw7R53z3g/HOCKV+hh AVBnIh5cs0W0kIB07pKRcWKoOctBhN4LPnS9kL0YPMLrx5ngjvViaEi1gHmxZ7RHWguc hRd2SweNitC8oxEaQUVuqdoj0hTV+PzHEH9ynJuLv4HjuUZA0h3CL1y2HQi26UrMefGr XsMrLrH903ILXZ47LaOXdwgOg4sXtFeS2wUWavDDoslVxLzmygSfdQPs+Bc/bJai+9Di tUiQ== 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:references:cc:to:from:subject:dkim-signature; bh=YyyKScmQhEAZVNkzHwbTVOTJjSJ/MJlKx+aVNyzmssE=; b=cUV/4h5ajpKwYpLP0nOOb8JrXEPFpjQdXI+pUFcnwmvXpqzlPYIj2QzAGT6VElF1R0 fBgOy+BhiBg4ztjOMz0+ein22iqhnO23c3F3HQtGaTUk7fHriF7O8l7lqJYS17N76+t3 PbttYJ43Z4QkSDnXuIV07T9pnxkNqmsrejwaEoapqzH4fRkIEtF9M4TSfiWG9MLgnq+0 ZeoG5J9yZYTrshFRQcTx4oy3Z0J41hjzdYw47O0cIZLuQn0uWAj+8A5S0dV01YNHc3Vz l8tjUMaGOJaiBDrBpNKm8oTDAryBR+dtBkNZtLHtO6uvH1dnXC9wHJhsV8sqYxYbSthB 1LPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jSlsS54z; 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 i16si6589578ejc.140.2019.10.07.02.12.30; Mon, 07 Oct 2019 02:12: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=jSlsS54z; 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 S1727355AbfJGJKY (ORCPT + 99 others); Mon, 7 Oct 2019 05:10:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28143 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727262AbfJGJKY (ORCPT ); Mon, 7 Oct 2019 05:10:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570439423; 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=YyyKScmQhEAZVNkzHwbTVOTJjSJ/MJlKx+aVNyzmssE=; b=jSlsS54zLz2ExihxvEpHKH3YnFiMGfiRXcc5ah0YiaawHXAiKdYZyFMtPRNL2lGg4AY9ck ffvdxhQ2NF2Nj6T0nExCuOLFXSki4pUKOgqBDVf05v8RxMBJk4C85kFZNLMPlmGLjLH/F4 m865p38LHA7AiJfj8yMMMQUj661Yjys= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-bcYbVBf3Nayl1oAfZFzPpw-1; Mon, 07 Oct 2019 05:10:21 -0400 Received: by mail-wr1-f70.google.com with SMTP id k2so7209265wrn.7 for ; Mon, 07 Oct 2019 02:10:21 -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:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qXE2Citr/8gr1JVjJBCMqiWsD3hna3z+ynmhIFXHtb4=; b=MJgsahzz0NZ3gVZrvDETNV2hiFiZE5Qa03ZqXZsShCWk55gja2uGWhUtXf+kCH1m1i /kGMDwTtNNy3TewRxyxe2CVsGMrMc1sTQIMwy4N4ukNgVUbmtr382OIivY8TLWyvP7Bb 6he04+gAhZ7qEhEKNUabpZgmDat8fUelWcnVRJBxxc4+YpxGUXUa3wdOpdwXg1MMcTso JYMvSAFAQkXOR1yLcaEdMJpbs8S2mbyj+flBCanqXPyrQABIttwvJAK1LcYSJwMHItOp EDNwk1vTRAITxgpZXZBEPvLQ4GTbtfm9S+BhfVKFH/xk44J8tdoVKq8XGF6bXPvYGjTb CF6Q== X-Gm-Message-State: APjAAAUfEu+3n86i8iqE/UpO7auj3To1cocsXzay3lNjJuiDsCxv/xxb ghub2AI4VPwUVg6x5E4MKzZbxqtTsDKqhmLRfLz/9HBcyeLKaowmTB83ItNuPQiHyl0kk0Lbf2F tSljeDgX6dYg5oes4MmWfzC0k X-Received: by 2002:adf:dbce:: with SMTP id e14mr20591480wrj.56.1570439420124; Mon, 07 Oct 2019 02:10:20 -0700 (PDT) X-Received: by 2002:adf:dbce:: with SMTP id e14mr20591452wrj.56.1570439419954; Mon, 07 Oct 2019 02:10:19 -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 a9sm22019164wmf.14.2019.10.07.02.10.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 02:10:19 -0700 (PDT) Subject: Re: kexec breaks with 5.4 due to memzero_explicit From: Hans de Goede To: Arvind Sankar , linux-kernel@vger.kernel.org Cc: Ingo Molnar , x86@kernel.org References: <20191007030939.GB5270@rani.riverdale.lan> <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> Message-ID: <0f083019-61e8-7ed5-dde7-99e1aa363d9c@redhat.com> Date: Mon, 7 Oct 2019 11:10:18 +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: <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> Content-Language: en-US X-MC-Unique: bcYbVBf3Nayl1oAfZFzPpw-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 10:50, Hans de Goede wrote: > Hi, >=20 > 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. >=20 > Hmm, it (obviously) does build for me and using kexec still also works > for me. >=20 > 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 before = my patch: [hans@shalem linux]$ ld arch/x86/purgatory/purgatory.ro ld: warning: cannot find entry symbol _start; defaulting to 000000000040100= 0 ld: arch/x86/purgatory/purgatory.ro: in function `sha256_transform': sha256.c:(.text+0x1c0c): undefined reference to `memzero_explicit' And I can confirm that it is gone after my patch: [hans@shalem linux]$ ld arch/x86/purgatory/purgatory.ro ld: warning: cannot find entry symbol _start; defaulting to 000000000040100= 0 Regards, Hans *) I tried with a Fedora signed kernel, dunno how to trigger this if that d= oes not trigger it