linux-origin
[Top] [All Lists]

sys32_newstat() and friends

To: linux-origin@xxxxxxxxxxx
Subject: sys32_newstat() and friends
From: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
Date: Thu, 6 Jul 2000 13:05:47 +0200
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;
}

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.

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

  Ralf

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