Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4289993ybp; Mon, 7 Oct 2019 06:20:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxgUY9jeUnGaSbL3AaoMpzIvu2whinh+tPJoPQBN85g4bW4dEwAO0k8O5xf5RLS2Kq931n X-Received: by 2002:a17:906:1801:: with SMTP id v1mr23724116eje.146.1570454438581; Mon, 07 Oct 2019 06:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570454438; cv=none; d=google.com; s=arc-20160816; b=vThQZXE/RBkTymebtNzPpukAMj+0DcV1UYXLp4xpTPDUGogcIhyj/zA2+uzTHUBhjM NCo/KVdiIowrWG3IGHDRHzsW4Io/T7jBM71sJGEnfihbCrxPQJZ0YYhF2GJk61DQgIn6 HczZmIWsEE5jK11epcn0us+8MA/f6ps97yrEDzEyXzolgDhM6rDwv7x2xGcSi+uoH950 Oyaktl17JwydGR6AF+msjbdGKwu6zIU592pBsjbjfNA6EptxzRtVU/K04AzdjwdDiap/ /lHYir6qgzkmqhGmlmm/M2ZMKJ6leWO8JXQUaI+AQvMU7UdNYM7gisWMNIHKE7BzAXsf HN1g== 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:date:from:dkim-signature; bh=ArSSEDv4lyQP/OrcqpZe2TGjCZz/1L6jU4R7IDnkjN4=; b=C30fnPZsKl6KPm1hKvHQUFfJSJkDkeH+SWTSl1ya0/d4ezoxbNVbpmAh9yWk4KM7ww r09sf4codDXIrZUZBK8S+JPnat18Q3NRF8M8Ez5TUtBJHdyFXJlkd++Gm5GY44Y8KUqs 3srmYlrnBhg96MFfnVYQtva4gu5z5HBIdWi+ZXnWABGIndX+UjS2yGYKVST8WpQFJif8 Pv+IHV2T2jPZADau8f+6ltwdBGFIQyd76fyW/KbNib4B8G9K4lCsReQe5Kwu0n622WMJ PPjV5a43HwNdfm38ePjgPWDkvi7es9h2CdFOeA4EOmY8w7HQMHz9A1RygO6WlDniuPvJ VUVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vUoJROOX; 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 n4si6496296ejj.132.2019.10.07.06.20.14; Mon, 07 Oct 2019 06:20:38 -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=vUoJROOX; 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 S1727716AbfJGNUI (ORCPT + 99 others); Mon, 7 Oct 2019 09:20:08 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35030 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727490AbfJGNUI (ORCPT ); Mon, 7 Oct 2019 09:20:08 -0400 Received: by mail-qk1-f196.google.com with SMTP id w2so12509690qkf.2 for ; Mon, 07 Oct 2019 06:20:08 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ArSSEDv4lyQP/OrcqpZe2TGjCZz/1L6jU4R7IDnkjN4=; b=vUoJROOXR19pSID9iYGsZr3aJ/iSaMwyg/gFITja6apByae1ikYHQKJuWx8A7bc2Pj IoerTaClvbhv/fpepH3FYMo8152KwzdV1JdJjZcVfrFCsCIGl24RXV/fN3gd7wVqsv3+ 49a95qM8o0gRX2QCTAtqQOpM57SCxdhoPa/Fsxpt6qPe7vOytyM1jxL8CSu5hxmvrQbS O/6M2xKVmMKGAi4Vq9CK0LsfPBxm8cONiVlQxHWXmrmSKyG7qJxCZ6pPi/7htwkfaC9z Ci4IPJGg48EBMFOwAHlV8GUfOVYZcTDj8iTPZ13+gLjvwIXFXEvFnoBZ9iRjZUUPujn9 0eaQ== 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 :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ArSSEDv4lyQP/OrcqpZe2TGjCZz/1L6jU4R7IDnkjN4=; b=l4Q+U06ookwDyZDyoeV9dZFQN0EMyhfcY21pJ1BFlfv90Gs5dAVEoGNCdse10OzOZZ 2YWzcpQhfXwUsn4Ces+w6LwG6/p8vjfI7LNrFff/26K7M1U90MRFm9WjIk8dmWSYG4Xp iIgP/4Dn248uvAhi+s/AAPBHSMM5EQ3NcpLhEFuRNUOaCCOf9vPzNvn1AqlAl+s2UczY cr9ITJwZWSo8wnJbJ0qzZZ341jl8sUfInOeT5hIsvtzYwCi7iC3mwpsXrx7kfVEnRm3s RQtWxKzqSbmi/ZGLQLHvYMeGJte3ymur0EjgY0pBCLJLx0hV7HGEkJ3M1MJCttuBkfOZ XbGg== X-Gm-Message-State: APjAAAV27abzxAtR33tQY9YceUPYvRPc7WsUspVsVGj0xnOBCG/YEeju C+8YSaA2SNvfiPn8MMjMtkEGIBSF/Q4IUA== X-Received: by 2002:ae9:eb51:: with SMTP id b78mr23951361qkg.452.1570454407344; Mon, 07 Oct 2019 06:20:07 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id t19sm6850145qto.55.2019.10.07.06.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 06:20:07 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 7 Oct 2019 09:20:05 -0400 To: Hans de Goede Cc: Arvind Sankar , linux-kernel@vger.kernel.org, Ingo Molnar , x86@kernel.org Subject: Re: kexec breaks with 5.4 due to memzero_explicit Message-ID: <20191007132005.GB269842@rani.riverdale.lan> References: <20191007030939.GB5270@rani.riverdale.lan> <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> <0f083019-61e8-7ed5-dde7-99e1aa363d9c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0f083019-61e8-7ed5-dde7-99e1aa363d9c@redhat.com> 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 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 before my patch: 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? LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib 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? > > [hans@shalem linux]$ ld arch/x86/purgatory/purgatory.ro > ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000 > 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 0000000000401000 > > Regards, > > Hans > > > *) I tried with a Fedora signed kernel, dunno how to trigger this if that does not > trigger it > It triggers an error for me when loading the new image, i.e. when doing # kexec -s -l new_image Not sure what the difference is, mine is a custom configuration built using mainline sources.