[Top][All Lists]

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

Re: [Qemu-devel] [PATCH] linux-user: Don't overrun guest buffer in sched

From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] linux-user: Don't overrun guest buffer in sched_getaffinity
Date: Wed, 28 May 2014 11:55:47 +0100

On 15 May 2014 14:40, Peter Maydell <address@hidden> wrote:
> If the guest's "long" type is smaller than the host's, then
> our sched_getaffinity wrapper needs to round the buffer size
> up to a multiple of the host sizeof(long). This means that when
> we copy the data back from the host buffer to the guest's
> buffer there might be more than we can fit. Rather than
> overflowing the guest's buffer, handle this case by returning
> EINVAL or ignoring the unused extra space, as appropriate.
> Note that only guests using the syscall interface directly might
> run into this bug -- the glibc wrappers around it will always
> use a buffer whose size is a multiple of 8 regardless of guest
> architecture.

In fact it turns out that gcc 4.9 compiled ARM binaries will
run into this, because libgomp does direct syscalls as part
of its initialization:



Cc: address@hidden

> Signed-off-by: Peter Maydell <address@hidden>

Also: ping! :-)

-- PMM

reply via email to

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