NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55979 (sh single quotes removes nul characters)

Have we tried using ASAN to troubleshoot this?

> the you provided a link to earlier started \177ELF

That's because the binary modified itself. The code following MZqFpD='' is a printf ELF>$0 so the first 64 bytes have a conventional ELF header for subsequent invocations. Try downloading again. That file can be your test case. I can create a more minimal one too if you need it.

On Wed, Feb 10, 2021 at 5:25 AM Robert Elz <> wrote:
The following reply was made to PR bin/55979; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: Justine Tunney <>
Subject: Re: bin/55979 (sh single quotes removes nul characters)
Date: Wed, 10 Feb 2021 20:24:28 +0700

     Date:        Tue, 9 Feb 2021 20:08:50 -0800
     From:        Justine Tunney <>
     Message-ID:  <>

 One more thing:

   |      11172      1 sh       CALL mmap(0,0x1000,PROT_READ|PROT_WRITE,0x1002<PRIVATE,ANONYMOUS,ALIGN=NONE>,0xffffffff,0,0)
   |      11172      1 sh       RET   mmap 126131311058944/0x72b73bfda000

 That's very odd, sh doesn't call mmap() anywhere (and doesn't use stdio
 for input/output either) and doesn't dynamically load anything either
 (libc and libedit should have been loaded at startup).   Are you sure
 that's the NetBSD /bin/sh doing that?

 In that sh, do "echo $NETBSD_SHELL" and show what it says please.


Home | Main Index | Thread Index | Old Index