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