linux-origin
[Top] [All Lists]

Re: sys32_newstat() and friends

To: ralf@xxxxxxxxxxxxxx (Ralf Baechle)
Subject: Re: sys32_newstat() and friends
From: Kanoj Sarcar <kanoj@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 Jul 2000 15:27:43 -0700 (PDT)
Cc: linux-origin@xxxxxxxxxxx
In-reply-to: <20000706130547.A6744@bacchus.dhis.org> from "Ralf Baechle" at Jul 06, 2000 01:05:47 PM
Sender: owner-linux-origin@xxxxxxxxxxx
> 
> This is sys32_newstat from today's CVS:
> 
> asmlinkage int
> sys32_newstat(char * filename, struct stat32 *statbuf)
> {
>         int ret;
>         struct stat s;
>         mm_segment_t old_fs = get_fs();
> 
>         set_fs (KERNEL_DS);
>         ret = sys_newstat(filename, &s);
>         set_fs (old_fs);
>         if (putstat (statbuf, &s))
>                 return -EFAULT;
> 
>         return ret;
> }

Whoever did this picked the arch/ia64/ia32/sys_ia32.c verbatim.

> 
> Note that set_fs(KERNEL_DS) also allows the filename to be fetched from
> anywhere in memory including kernel space resulting in a potencial
> information leak or crash.

Define how you can get a information leak or crash. I haven't looked
too closely, but I assume the fs/namei.c routines protect themselves.
In any case, most other ioctls on 64 bit platforms have this same problem
then.

> 
> Question: why do we have two implementations of each of sys32_newstat,
> sys32_newlstat and sys32_newfstat in linux32.c?
>

One is probably the sparc64, and the other the ia64 implementation.

Kanoj
 
>   Ralf
> 


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