Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / x86_64 / ia32 / sys_ia32.c
index 0a8fb7d..5ab4d2e 100644 (file)
@@ -20,7 +20,6 @@
  * This should be fixed.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
@@ -77,6 +76,8 @@
 
 int cp_compat_stat(struct kstat *kbuf, struct compat_stat __user *ubuf)
 {
+       compat_ino_t ino;
+
        typeof(ubuf->st_uid) uid = 0;
        typeof(ubuf->st_gid) gid = 0;
        SET_UID(uid, kbuf->uid);
@@ -85,9 +86,12 @@ int cp_compat_stat(struct kstat *kbuf, struct compat_stat __user *ubuf)
                return -EOVERFLOW;
        if (kbuf->size >= 0x7fffffff)
                return -EOVERFLOW;
+       ino = kbuf->ino;
+       if (sizeof(ino) < sizeof(kbuf->ino) && ino != kbuf->ino)
+               return -EOVERFLOW;
        if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct compat_stat)) ||
            __put_user (old_encode_dev(kbuf->dev), &ubuf->st_dev) ||
-           __put_user (kbuf->ino, &ubuf->st_ino) ||
+           __put_user (ino, &ubuf->st_ino) ||
            __put_user (kbuf->mode, &ubuf->st_mode) ||
            __put_user (kbuf->nlink, &ubuf->st_nlink) ||
            __put_user (uid, &ubuf->st_uid) ||
@@ -509,11 +513,6 @@ sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
        return compat_sys_wait4(pid, stat_addr, options, NULL);
 }
 
-int sys32_ni_syscall(int call)
-{
-       return -ENOSYS;
-}
-
 /* 32-bit timeval and related flotsam.  */
 
 asmlinkage long
@@ -864,11 +863,6 @@ asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
        if (IS_ERR(filename))
                return error;
        error = compat_do_execve(filename, argv, envp, regs);
-       if (error == 0) {
-               task_lock(current);
-               current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
-       }
        putname(filename);
        return error;
 }
@@ -911,7 +905,7 @@ long sys32_vm86_warning(void)
        struct task_struct *me = current;
        static char lastcomm[sizeof(me->comm)];
        if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) {
-               printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
+               compat_printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
                       me->comm);
                strncpy(lastcomm, me->comm, sizeof(lastcomm));
        } 
@@ -924,12 +918,3 @@ long sys32_lookup_dcookie(u32 addr_low, u32 addr_high,
        return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len);
 }
 
-static int __init ia32_init (void)
-{
-       printk("IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $\n");  
-       return 0;
-}
-
-__initcall(ia32_init);
-
-extern unsigned long ia32_sys_call_table[];