[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Add naive implementation of capget(
From: |
Karol Lewandowski |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Add naive implementation of capget() syscall |
Date: |
Tue, 25 Sep 2012 16:09:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 |
On 09/22/2012 02:07 PM, Blue Swirl wrote:
Hi!
>> +static int sys_capget(struct __user_cap_header_struct *hdr, struct
>> __user_cap_data_struct *data)
>> +{
>> + return (capget(hdr, data));
>
> This is not correct. The structure needs to be converted field by
> field to host native format, especially endianness.
Right, that was too naive. :)
> The parenthesis aren't useful.
Will drop those.
>> +}
>> +
>> #ifdef CONFIG_ATFILE
>> /*
>> * Host system seems to have atfile syscall stubs available. We
>> @@ -7436,7 +7443,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
>> arg1,
>> unlock_user(p, arg1, ret);
>> break;106.116.62.75
>> case TARGET_NR_capget:
>> - goto unimplemented;
>> + {
>> + void *p2 = NULL;
>> + if (!(p = lock_user(VERIFY_WRITE, arg1, sizeof(struct
>> __user_cap_header_struct), 0)))
>> + goto efault;
>
> Here and below you also assume that host structure size matches guest.
Hmm, all the fields in these structures are __u32 but one. Will fix
that.
> Missing braces, please read CODING_STYLE and use checkpatch.pl.
Ok, good.
Thanks a lot for review!
Regards,
--
Karol Lewandowski | Samsung Poland R&D Center | Linux/Platform