From patchwork Thu Feb 20 01:18:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 2049780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=gmx.net header.i=ps.report@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=X0QqYGqy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4YzC3C3RGwz1yCp for ; Thu, 20 Feb 2025 23:18:29 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id D87F7352089B; Thu, 20 Feb 2025 13:18:22 +0100 (CET) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=gmx.net header.i=ps.report@gmx.net header.a=rsa-sha256 header.s=s31663417 header.b=X0QqYGqy; dkim-atps=neutral Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by helium.openadk.org (Postfix) with ESMTPS id 6E788352088C for ; Thu, 20 Feb 2025 13:18:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1740053897; x=1740658697; i=ps.report@gmx.net; bh=S+bHaMxZIWU597V2Oct6rd6ZZ3MOJjgnXqd/rkoYsH0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=X0QqYGqyLy+rSn18/xFYqD1ImvCjnJ9/rZGF8mvq7s86VRe4Bv7W+zm760LrkjHx dhV70+YrZt724jk3221UmwxUzryDqA8C4RfDnaRmMCCKXEhelYBEXrap/W3NVzqV7 0tw8I8WnPAtIzb7rZMyvxXzcdsH1YoGVXmTC2n1UrpNiVUW8EWbOIpi5UKxMTblxn n+h+sB21zB8KOYbWyiuQorl2u9DPOxS0r0jrwdankyF8lTt636Q00PAGmtADOPjVZ 0dpqUdAFn1oANbskXDkUZi4AOkUWLE1xDhqRu2/KaZuzIsZCEcrFDYB8Nmjz1c54s /evJ0uERaxHfhabVfw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from localhost.fritz.box ([82.135.81.94]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5G9t-1tJY8y0wvl-00welc; Thu, 20 Feb 2025 13:18:17 +0100 From: Peter Seiderer To: devel@uclibc-ng.org Date: Thu, 20 Feb 2025 13:18:16 +0100 Message-ID: <20250220121816.672545-1-ps.report@gmx.net> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:7fDSPIyO9pnKd4WvhkynQAwT8qrw0eVfMb2Hm2r8HeSKt+miLJZ T7xT5lfxs27A7h7AKjuKqpuT5uuYUTr7EvV+8xkHGgj+HjQP3ianDEDIb19O1S2vncB+QxZ fbbtB66F1yxpCmKDqae4BAr4QiwgHbN8DUrJg6VGAH7jvIbL43bB8g/gS7WfNPfV8YW4ts0 23Fz3fds8Fy50hFjxmU5A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:kvJU9AycDgo=;P8G3YECilDzO80rjPVI4lI6pOL3 Ew7WE8E/P/KWqrnFsucmu3tCmA/M0A2Qv24egS/ZytoI7M+uMVj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8bvmNojZvmCVdCc/Fi41fgA47hPMDrdB/GtoHhrl78 pQV1o+/QUbsF5lFGKoAp62iBTeikHmi37CiuE+thR5VGBUBt9b+U725qy65b0JYnYI7ctqZ4F TrAaoN6bXQhSZtreCZHguWO1tGqVE5LarX0jHjdHSMPwbPmgKgJWjCaZsw+7YaYNnkkyZueVm Erpuc64IN/hj9sOQ/NLUAk4dJzL4Xl0SyctCJiSllxkaRXtkEKOurGqhOUeqlDqqB2mC97cCY 1h1+muemJMa0xSGSlv4PjyvGtkfWIZgatBcZTOeQUruNK8s57J+5l6Budj Message-ID-Hash: BRNRKAREGTN2KNEZPUT347QLT62LMJXG X-Message-ID-Hash: BRNRKAREGTN2KNEZPUT347QLT62LMJXG X-MailFrom: ps.report@gmx.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Waldemar Brodkorb , Jean-Michel Hautbois X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH v2] m68k: fix SUPPORT_LD_DEBUG null pointer access List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fix null pointer access in case SUPPORT_LD_DEBUG configuration option is enabled (hit in _dl_do_reloc, but fix same old_val/reloc_addr usage pattern in _dl_do_lazy_reloc too). Reported-by: Jean-Michel Hautbois Link: https://mailman.openadk.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/thread/ODLJ53XJU5ZG3OLHVJMVWSNBYIFHFBAT/ Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - fix same old_val/reloc_addr usage pattern in _dl_do_lazy_reloc too - reword commit message --- ldso/ldso/m68k/elfinterp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldso/ldso/m68k/elfinterp.c b/ldso/ldso/m68k/elfinterp.c index 25ea23067..e7fa117da 100644 --- a/ldso/ldso/m68k/elfinterp.c +++ b/ldso/ldso/m68k/elfinterp.c @@ -193,7 +193,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, #endif #if defined (__SUPPORT_LD_DEBUG__) - old_val = *reloc_addr; + old_val = reloc_addr ? *reloc_addr : 0; #endif switch (reloc_type) { @@ -292,7 +292,7 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, reloc_type = ELF_R_TYPE(rpnt->r_info); #if defined (__SUPPORT_LD_DEBUG__) - old_val = *reloc_addr; + old_val = reloc_addr ? *reloc_addr : 0; #endif switch (reloc_type) {