diff options
Diffstat (limited to 'arch/sparc64/solaris/fs.c')
-rw-r--r-- | arch/sparc64/solaris/fs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 0f0eb6aa1c40..12a940cc791f 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c | |||
@@ -82,12 +82,17 @@ struct sol_stat64 { | |||
82 | 82 | ||
83 | static inline int putstat(struct sol_stat __user *ubuf, struct kstat *kbuf) | 83 | static inline int putstat(struct sol_stat __user *ubuf, struct kstat *kbuf) |
84 | { | 84 | { |
85 | u32 ino; | ||
86 | |||
85 | if (kbuf->size > MAX_NON_LFS || | 87 | if (kbuf->size > MAX_NON_LFS || |
86 | !sysv_valid_dev(kbuf->dev) || | 88 | !sysv_valid_dev(kbuf->dev) || |
87 | !sysv_valid_dev(kbuf->rdev)) | 89 | !sysv_valid_dev(kbuf->rdev)) |
88 | return -EOVERFLOW; | 90 | return -EOVERFLOW; |
91 | ino = kbuf->ino; | ||
92 | if (sizeof(ino) < sizeof(kbuf->ino) && ino != kbuf->ino) | ||
93 | return -EOVERFLOW; | ||
89 | if (put_user (sysv_encode_dev(kbuf->dev), &ubuf->st_dev) || | 94 | if (put_user (sysv_encode_dev(kbuf->dev), &ubuf->st_dev) || |
90 | __put_user (kbuf->ino, &ubuf->st_ino) || | 95 | __put_user (ino, &ubuf->st_ino) || |
91 | __put_user (kbuf->mode, &ubuf->st_mode) || | 96 | __put_user (kbuf->mode, &ubuf->st_mode) || |
92 | __put_user (kbuf->nlink, &ubuf->st_nlink) || | 97 | __put_user (kbuf->nlink, &ubuf->st_nlink) || |
93 | __put_user (kbuf->uid, &ubuf->st_uid) || | 98 | __put_user (kbuf->uid, &ubuf->st_uid) || |