From: Karol Lewandowski <k.lewandowsk@samsung.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: riku.voipio@iki.fi, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: Add naive implementation of capget() syscall
Date: Tue, 25 Sep 2012 16:09:55 +0200 [thread overview]
Message-ID: <5061BB33.7000009@samsung.com> (raw)
In-Reply-To: <CAAu8pHvyKqDna_5rtTUZbi=pn2aoD+WK+xpjRH-jj0W7b+ZXsg@mail.gmail.com>
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
prev parent reply other threads:[~2012-09-25 14:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 15:09 [Qemu-devel] [PATCH] linux-user: Add naive implementation of capget() syscall Karol Lewandowski
2012-09-22 12:07 ` Blue Swirl
2012-09-22 23:23 ` Erik de Castro Lopo
2012-09-23 16:02 ` Blue Swirl
2012-09-24 13:47 ` Peter Maydell
2012-09-25 14:09 ` Karol Lewandowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5061BB33.7000009@samsung.com \
--to=k.lewandowsk@samsung.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.