qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: correct reboot()


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] linux-user: correct reboot()
Date: Mon, 7 Jan 2013 21:02:11 +0000

On 7 January 2013 20:51, Laurent Vivier <address@hidden> wrote:
> Le lundi 07 janvier 2013 à 20:42 +0000, Peter Maydell a écrit :
>> On 7 January 2013 20:30, Laurent Vivier <address@hidden> wrote:
>> > +           ret = reboot(arg1, arg2, arg3, (void*)(unsigned long)arg4);
>>
>> I don't think we should pass arg4 in this case. It's a pointer, so it's
>> definitely wrong to pass a pointer we haven't converted somehow.
>> Just passing NULL would be better, I  think; that will be safe and
>> make it reasonably obvious we need to fix something if the kernel
>> ever for some reason adds a new command that takes an argument.
>
> Yes, but in the traces I have, arg4 is 1. Can we accept to loose it ?

That will be because the syscall is just picking up whatever random
junk happens to be in the register than arg4 gets passed in. If you
look at the kernel sources:
http://lxr.linux.no/#linux+v3.7.1/kernel/sys.c#L425
'arg' is ignored for every other command.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]