With the current fake /proc/self/stat implementation `ps` is
segfaulting because it expects to read PID and argv[0] as first and
second field respectively, with the latter being enclosed between
backets.
Reproducing is as easy as running: `ps` inside qemu-user chroot
with /proc mounted.
ts-bprm-argv seems NULL here.
Isn't it supposed to be set?
--
Fabio Erculiani
On 03.01.2012, at 17:07, Fabio Erculiani wrote:
ts-bprm-argv seems NULL here.
Isn't it supposed to be set?
Good question. Maybe we need some other way to fetch argv0 then?
Alex
On Tue, Jan 3, 2012 at 6:41 PM, Alexander Graf ag...@suse.de wrote:
On 03.01.2012, at 17:07, Fabio Erculiani wrote:
ts-bprm-argv seems NULL here.
Isn't it supposed to be set?
Good question. Maybe we need some other way to fetch argv0 then?
or we could leave just an empty string for now -
Or just using linux_binprm-filename with basename()
--
Fabio Erculiani
On 03.01.2012, at 19:08, Fabio Erculiani wrote:
Or just using linux_binprm-filename with basename()
No, that'd be wrong since argv[0] can be different from the actual file name.
Also it can be the full path or not depending on what the initiator defined.
Alex
On 03.01.2012, at 19:04, Fabio Erculiani wrote:
On Tue, Jan 3, 2012 at 6:41 PM, Alexander Graf ag...@suse.de wrote:
On 03.01.2012, at 17:07, Fabio Erculiani wrote:
ts-bprm-argv seems NULL here.
Isn't it supposed to be set?
Good question. Maybe we need some other way to fetch argv0
How about setting ts-bprm-argv = target_argv; ?
I'm not a qemu codebase expert, but if it's always NULL (why is it
NULL?) or can be NULL...
It looks like can be done easily from main.c... without making a
variable global.
--
Fabio Erculiani
Mumble,
that is what happens already...
Let me see why I get NULL here...
--
Fabio Erculiani
On 03.01.2012, at 19:46, Fabio Erculiani wrote:
How about setting ts-bprm-argv = target_argv; ?
I'm not a qemu codebase expert, but if it's always NULL (why is it
NULL?) or can be NULL...
It should already be set it loader_exec. I don't know why it's NULL there for
you. I suppose some debug
Yeah, debugging.
Moreover we have this scenario:
$ /bin/cat /proc/self/stat
32297 (cat) ..
I guess we should use basename() anyway...?
--
Fabio Erculiani
On 03.01.2012, at 19:54, Fabio Erculiani wrote:
Yeah, debugging.
Moreover we have this scenario:
$ /bin/cat /proc/self/stat
32297 (cat) ..
I guess we should use basename() anyway...?
argv[0] can be an arbitrary value passed in through execve. In qemu's
linux-user emulation you
Ok, I've found the reason, i guess it's a bug.
target_argv pointer is placed in bprm-argv;
But then target_argv is freed and nullified.
loader_exec should just allocate a new char** and copy target_argv.
I tried that and it worked.
The problem is, where do I free() it? Am i supposed to do it or
On 03.01.2012, at 20:11, Fabio Erculiani wrote:
Ok, I've found the reason, i guess it's a bug.
target_argv pointer is placed in bprm-argv;
But then target_argv is freed and nullified.
loader_exec should just allocate a new char** and copy target_argv.
I tried that and it worked.
The
Done, it all works now ;-) !
--
Fabio Erculiani
15 matches
Mail list logo