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 / mips / kernel / linux32.c
index dc4b7a8..2d5c902 100644 (file)
@@ -5,7 +5,6 @@
  * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com)
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -79,6 +78,8 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
        memset(&tmp, 0, sizeof(tmp));
        tmp.st_dev = new_encode_dev(stat->dev);
        tmp.st_ino = stat->ino;
+       if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino)
+               return -EOVERFLOW;
        tmp.st_mode = stat->mode;
        tmp.st_nlink = stat->nlink;
        SET_UID(tmp.st_uid, stat->uid);