diff options
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 8a31fc1bfb15..ad6173651995 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -111,22 +111,26 @@ struct osf_dirent_callback { | |||
111 | 111 | ||
112 | static int | 112 | static int |
113 | osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, | 113 | osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, |
114 | ino_t ino, unsigned int d_type) | 114 | u64 ino, unsigned int d_type) |
115 | { | 115 | { |
116 | struct osf_dirent __user *dirent; | 116 | struct osf_dirent __user *dirent; |
117 | struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; | 117 | struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; |
118 | unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1); | 118 | unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1); |
119 | unsigned int d_ino; | ||
119 | 120 | ||
120 | buf->error = -EINVAL; /* only used if we fail */ | 121 | buf->error = -EINVAL; /* only used if we fail */ |
121 | if (reclen > buf->count) | 122 | if (reclen > buf->count) |
122 | return -EINVAL; | 123 | return -EINVAL; |
124 | d_ino = ino; | ||
125 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | ||
126 | return -EOVERFLOW; | ||
123 | if (buf->basep) { | 127 | if (buf->basep) { |
124 | if (put_user(offset, buf->basep)) | 128 | if (put_user(offset, buf->basep)) |
125 | return -EFAULT; | 129 | return -EFAULT; |
126 | buf->basep = NULL; | 130 | buf->basep = NULL; |
127 | } | 131 | } |
128 | dirent = buf->dirent; | 132 | dirent = buf->dirent; |
129 | put_user(ino, &dirent->d_ino); | 133 | put_user(d_ino, &dirent->d_ino); |
130 | put_user(namlen, &dirent->d_namlen); | 134 | put_user(namlen, &dirent->d_namlen); |
131 | put_user(reclen, &dirent->d_reclen); | 135 | put_user(reclen, &dirent->d_reclen); |
132 | if (copy_to_user(dirent->d_name, name, namlen) || | 136 | if (copy_to_user(dirent->d_name, name, namlen) || |