From nobody Sun Feb 8 13:38:57 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE332EB64D9 for ; Mon, 10 Jul 2023 08:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbjGJIOv (ORCPT ); Mon, 10 Jul 2023 04:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjGJIN5 (ORCPT ); Mon, 10 Jul 2023 04:13:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23771E1; Mon, 10 Jul 2023 01:13:56 -0700 (PDT) Date: Mon, 10 Jul 2023 08:13:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688976834; h=from:from:sender:sender:reply-to: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=/Aa8ViPN2c8hO3w2Nhk0VmIBYhoiv9WTo6E6nOQzuJ4=; b=lVrBwyQmImYHl4E85lTfmTWMjKokLQ9qhPkfcVzi8/4XBQqIzGtmkUZSPB7F7qglgPv9+j Uo2pE4DmnXFZhxkkeSOmxp97bfdYCBHwTU5LuWJds6Ox4AtHCHa2aVLkZc+CbOHJk4+HGb u0q1C0mMdvVK4FXqa6PNdlvd8qaVwjnmPNdv1SfWcmiTKbN/nPXkUt7ssWyKYqZiHX0zh0 iLVFqpOqYPRAhnrK3sdwhatvKSzVdhbGf+beFpDgVJfOv2NSGl+EUoFOHnRpqf9R1EdVVB +wuhQKQfeTB3IhqQZ5l2HMfdgbokaQskF4H/oZ12GqsOqo5eKL1q5a1ulGTzZQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688976834; h=from:from:sender:sender:reply-to: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=/Aa8ViPN2c8hO3w2Nhk0VmIBYhoiv9WTo6E6nOQzuJ4=; b=MxglSJcjZYJq1Sr7syHndkCEwcKRMR1SgGkX5WWe+tDb0YgLo25ZdCnuV4KjPKqvY//gPr uYjMUz1k784Vx3AA== From: "tip-bot2 for Michal Kubecek" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/urgent] objtool: initialize all of struct elf Cc: Michal Kubecek , "Peter Zijlstra (Intel)" , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230629102051.42E8360467@lion.mk-sys.cz> References: <20230629102051.42E8360467@lion.mk-sys.cz> MIME-Version: 1.0 Message-ID: <168897683429.404.6801969953192508868.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 9f71fbcde2820f2af4658313e808cf1e579190a4 Gitweb: https://git.kernel.org/tip/9f71fbcde2820f2af4658313e808cf1e5= 79190a4 Author: Michal Kubecek AuthorDate: Thu, 29 Jun 2023 12:05:05 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Jul 2023 09:52:28 +02:00 objtool: initialize all of struct elf Function elf_open_read() only zero initializes the initial part of allocated struct elf; num_relocs member was recently added outside the zeroed part so that it was left uninitialized, resulting in build failures on some systems. The partial initialization is a relic of times when struct elf had large hash tables embedded. This is no longer the case so remove the trap and initialize the whole structure instead. Fixes: eb0481bbc4ce ("objtool: Fix reloc_hash size") Signed-off-by: Michal Kubecek Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20230629102051.42E8360467@lion.mk-sys.cz --- tools/objtool/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index d420b5d..081befa 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -1005,7 +1005,7 @@ struct elf *elf_open_read(const char *name, int flags) perror("malloc"); return NULL; } - memset(elf, 0, offsetof(struct elf, sections)); + memset(elf, 0, sizeof(*elf)); =20 INIT_LIST_HEAD(&elf->sections);