Bug#970460: qemu-user: trashes argv[0] breaking multi-call binaries

Michael Tokarev <[email protected]>
Newsgroups gmane.linux.debian.devel.bugs.general,gmane.linux.debian.ports.68k,gmane.linux.debian.ports.superh
Message-ID <[email protected]>
16.09.2020 20:15, John Paul Adrian Glaubitz wrote:
> 
>> On Sep 16, 2020, at 6:57 PM, Thorsten Glaser <[email protected]> wrote:
>>
>> I’m attaching a test program that does the following:
>>
>> • if argv[1] is "-" it just outputs argv[0] and argv[1]
>> • otherwise it also execve(2)s argv[1] with its argv[0] set to "meow"
> 
> That’s been fixed upstream and can be configured with the qemu-binfmt.sh script and the option “preserved=yes”.

Where it's been fixed? current git version of scripts/qemu-binfmt-conf.sh
does not have 'preserved' option, and if the P flag is set when registering
binfmt, the kernel will _prepend_ additional argv[0] element which is not
expected by current linux-user/main.c code (so the tst.c example will be
running with 3 args, not 2).

Thanks,

/mjt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.