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)



The following reply was made to PR bin/55979; it has been noted by GNATS.

From: Kamil Rytarowski <kamil%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost, kre%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost, jtunney%gmail.com@localhost
Cc: 
Subject: Re: bin/55979 (sh single quotes removes nul characters)
Date: Wed, 10 Feb 2021 09:39:23 +0100

 MSan gives this:
 
 LC_ALL=C  /usr/src/bin/sh/sh ./hello.com
 cmdname=0x8 path=0x7f7fffffedac argv[0]=0x299f790
 cmdname=0x7140000000c0
 cmdname='/home/kamil/.local/bin/r���PQ������1۰��YXr�Æ?�'
 ==13613==WARNING: MemorySanitizer: use-of-uninitialized-value
     #0 0x46fcf3 in shellexec /usr/src/bin/sh/exec.c:138:18
     #1 0x464ddc in evalcommand /usr/src/bin/sh/eval.c:1392:3
     #2 0x44e198 in evaltree /usr/src/bin/sh/eval.c:375:4
     #3 0x5191cf in cmdloop /usr/src/bin/sh/main.c:320:4
     #4 0x5175fe in main /usr/src/bin/sh/main.c:262:3
     #5 0x41fa8b in ___start (/usr/src/bin/sh/sh+0x41fa8b)
 
   Uninitialized value was stored to memory at
     #0 0x46f31d in shellexec /usr/src/bin/sh/exec.c:126
     #1 0x464ddc in evalcommand /usr/src/bin/sh/eval.c:1392:3
     #2 0x44e198 in evaltree /usr/src/bin/sh/eval.c:375:4
     #3 0x5191cf in cmdloop /usr/src/bin/sh/main.c:320:4
     #4 0x5175fe in main /usr/src/bin/sh/main.c:262:3
     #5 0x41fa8b in ___start (/usr/src/bin/sh/sh+0x41fa8b)
 
   Uninitialized value was created by an allocation of 'cmdentry' in the
 stack frame of function 'evalcommand'
     #0 0x458420 in evalcommand /usr/src/bin/sh/eval.c:870
 
 SUMMARY: MemorySanitizer: use-of-uninitialized-value
 /usr/src/bin/sh/exec.c:138:18 in shellexec
 Exiting
 ./hello.com: 6: Syntax error: ")" unexpected
 
 There is something wrong with or around padvance(). ':' gets stripped
 from PATH and there is an uninitialized memory read.
 


Home | Main Index | Thread Index | Old Index