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 hello.com 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 https://justine.lol/hello.com 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 <kre%munnari.oz.au@localhost> 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 <jtunney%gmail.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
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 <jtunney%gmail.com@localhost>
     Message-ID:  <CANtdasQJxExVw_fpBHGX=qPWMs56PC-6RH6nufTYM-X25CCORQ%mail.gmail.com@localhost>

 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.

 kre




Home | Main Index | Thread Index | Old Index