linux-mips
[Top] [All Lists]

Re: Serious bug in uaccess.h

To: Fabrice Bellard <bellard@email.enst.fr>
Subject: Re: Serious bug in uaccess.h
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Tue, 27 Feb 2001 18:50:04 +0100
Cc: linux-mips@oss.sgi.com
In-reply-to: <Pine.GSO.4.02.10102271534030.22188-100000@donjuan.enst.fr>; from bellard@email.enst.fr on Tue, Feb 27, 2001 at 03:40:11PM +0100
References: <Pine.GSO.4.02.10102271534030.22188-100000@donjuan.enst.fr>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
On Tue, Feb 27, 2001 at 03:40:11PM +0100, Fabrice Bellard wrote:

> #define copy_from_user(to,from,n) ({ \
>       register void *__cu_to asm("$4"); \
>       register const void *__cu_from asm("$5"); \
>       register long __cu_len asm("$6"); \
>       \
>       __cu_to = (to); \
>       __cu_from = (from); \
>       __cu_len = (n); \
>       if (access_ok(VERIFY_READ, __cu_from, __cu_len)) \
>               __asm__ __volatile__( \
>                       ".set\tnoreorder\n\t" \
>                       __MODULE_JAL(__copy_user) \
> ...
> 
> But I am not sure that it is always correct. Any idea ?

While this should be correct - it was my original attempt also - it was
misscompiled by whatever C compiler I was using at that time.  If
egcs 1.1.2 and gcc 2.95 both compile this construct right now then I'd
say go for it.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>