From nobody@FreeBSD.org  Fri Feb 19 22:31:11 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A293B1065692
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Feb 2010 22:31:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 92B768FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Feb 2010 22:31:11 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o1JMVBo0063035
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Feb 2010 22:31:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o1JMVBtC063034;
	Fri, 19 Feb 2010 22:31:11 GMT
	(envelope-from nobody)
Message-Id: <201002192231.o1JMVBtC063034@www.freebsd.org>
Date: Fri, 19 Feb 2010 22:31:11 GMT
From: Jozsef Kovacs <jozsef.kovacs@datira.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ld-elf.so.1 infinite loop when executed
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         144116
>Category:       i386
>Synopsis:       ld-elf.so.1 infinite loop when executed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 19 22:40:01 UTC 2010
>Closed-Date:    Sun Feb 21 18:09:50 UTC 2010
>Last-Modified:  Sun Feb 21 18:09:50 UTC 2010
>Originator:     Jozsef Kovacs
>Release:        RELENG_7_2
>Organization:
Datira Ltd
>Environment:
FreeBSD kalman 7.2-RELEASE-p6 FreeBSD 7.2-RELEASE-p6 #0: Wed Feb  3 02:39:55 CET 2010     root@:/usr/obj/usr/src/sys/DATIRA  i386

>Description:
/libexec/ld-elf.so.1 when directly executed keeps loading itself over and over, causing 100% cpu load.
Compiling the library with -DDEBUG revealed that the following segment loops:
---
relocating "/usr/obj/usr/src/libexec/rtld-elf/ld-elf.so.1"
doing copy relocations
initializing key program variables
initializing thread locks
_rtld_thread_init: done
transferring control to program entry point = 0x15b0
/libexec/ld-elf.so.1 is initialized, base address = 0x0
RTLD dynamic = 0x270a0
RTLD pltgot  = 0x0
processing main program's program header
Ignoring d_tag 1879048186 = 0x6ffffffa
lm_init("(null)")
loading LD_PRELOAD libraries
loading needed objects
checking for required versions
initializing initial thread local storage
---

Expected behaviour:
$ /libexec/ld-elf.so.1
bash: /libexec/ld-elf.so.1: cannot execute binary file
Confirmed on a RELENG_6_3 machine


>How-To-Repeat:
execute /libexec/ld-elf.so.1
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Sun Feb 21 18:09:49 UTC 2010 
State-Changed-Why:  
This is something 'dont do that'. The ld.so file is a library, that 
should not be executed at all. consult questions@ for more information. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144116 
>Unformatted:
