qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] linux-user: Implement capget, capset


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] linux-user: Implement capget, capset
Date: Mon, 17 Mar 2014 12:12:25 +0000

On 17 March 2014 11:51, Riku Voipio <address@hidden> wrote:
> On Fri, Mar 14, 2014 at 06:10:50PM +0000, Peter Maydell wrote:
>> Implement the capget and capset syscalls. This is useful because
>> simple programs like 'ls' try to use it in AArch64
>
> I'm not seing this with ubuntu trusty, wookeys debian or my
> static busybox. Where is your ls from?

It's from the SuSE rootfs tarball. (The SuSE patchset
wires capget up to nowarn.

> Also, runnning qemu-linux
> user as root? How very brave :)
>
>> , and otherwise
>> we emit a lot of noise about it being unimplemented.
>
> Well, it seems gcc 4.8 isn't smart enough for this patch:
>
> linux-user/syscall.c: In function ‘do_syscall’:
> linux-user/syscall.c:7739:46: error: ‘target_data’ may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
>    target_data[i].effective = tswap32(data[i].effective);
>                             ^

Hohum. Let's just stick an = NULL on the target_data
definition.

>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>> Bugfix or feature? You decide :-)
>
> perhaps unimplemented_nowarn for now and a proper implementation for 2.1 ?

I guess that might be safer.

>
> Riku
>
>>  linux-user/syscall.c      | 71 
>> +++++++++++++++++++++++++++++++++++++++++++++--
>>  linux-user/syscall_defs.h | 11 ++++++++
>>  2 files changed, 80 insertions(+), 2 deletions(-)
>>
>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>> index 2a8b66c..53c3d69 100644
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -43,6 +43,7 @@
>>  #include <sys/resource.h>
>>  #include <sys/mman.h>
>>  #include <sys/swap.h>
>> +#include <sys/capability.h>
>
> This is from libcap-dev, which might not be installed by default. The
> actual capset/capget functions seems to be in libc.

Hmm. Looks like we need to use linux/capability.h and
roll our own capget/capset functions then. (We could
just provide the prototypes for the functions in libc
but since we have a _syscall macro anyway we may as well
use it...)

thanks
-- PMM



reply via email to

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