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

Laurent Vivier <[email protected]>
Newsgroups gmane.linux.debian.ports.68k,gmane.linux.debian.ports.superh
Message-ID <[email protected]>
Le 16/09/2020 à 19:53, Michael Tokarev a écrit :
> 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).

Yes, it's not fixed.

For 10 months I'm trying to have a patch merged into the kernel to be
able to detect if PRESERVE flag is set or not.

https://patchwork.kernel.org/patch/11354255/

Thanks,
Laurent
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.