On 20.11.2011, at 16:31, Peter Maydell wrote:
> On 20 November 2011 12:06, Alexander Graf wrote:
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -711,6 +711,9 @@ static inline int host_to_target_errno(int err)
>>
>> static inline int target_to_host_errno(int err)
>> {
>> +
On 20 November 2011 12:06, Alexander Graf wrote:
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -711,6 +711,9 @@ static inline int host_to_target_errno(int err)
>
> static inline int target_to_host_errno(int err)
> {
> + if (err >= ERRNO_TABLE_SIZE) {
> + return err;
>
While debugging some issues with QEMU_STRACE I stumbled over segmentation
faults that were pretty reproducible. Turns out we tried to treat a
normal return value as errno, resulting in an access over array boundaries
for the resolution.
Fix this by hard-mapping values above valid errnos to the ori