diff options
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/hpux/fs.c | 30 | ||||
-rw-r--r-- | arch/parisc/kernel/module.c | 14 |
2 files changed, 33 insertions, 11 deletions
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 1263f00dc35d..12c04c5e558b 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -84,22 +84,28 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
84 | if (reclen > buf->count) | 84 | if (reclen > buf->count) |
85 | return -EINVAL; | 85 | return -EINVAL; |
86 | d_ino = ino; | 86 | d_ino = ino; |
87 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | 87 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
88 | buf->error = -EOVERFLOW; | ||
88 | return -EOVERFLOW; | 89 | return -EOVERFLOW; |
90 | } | ||
89 | dirent = buf->previous; | 91 | dirent = buf->previous; |
90 | if (dirent) | 92 | if (dirent) |
91 | put_user(offset, &dirent->d_off); | 93 | if (put_user(offset, &dirent->d_off)) |
94 | goto Efault; | ||
92 | dirent = buf->current_dir; | 95 | dirent = buf->current_dir; |
96 | if (put_user(d_ino, &dirent->d_ino) || | ||
97 | put_user(reclen, &dirent->d_reclen) || | ||
98 | put_user(namlen, &dirent->d_namlen) || | ||
99 | copy_to_user(dirent->d_name, name, namlen) || | ||
100 | put_user(0, dirent->d_name + namlen)) | ||
101 | goto Efault; | ||
93 | buf->previous = dirent; | 102 | buf->previous = dirent; |
94 | put_user(d_ino, &dirent->d_ino); | 103 | buf->current_dir = (void __user *)dirent + reclen; |
95 | put_user(reclen, &dirent->d_reclen); | ||
96 | put_user(namlen, &dirent->d_namlen); | ||
97 | copy_to_user(dirent->d_name, name, namlen); | ||
98 | put_user(0, dirent->d_name + namlen); | ||
99 | dirent = (void __user *)dirent + reclen; | ||
100 | buf->current_dir = dirent; | ||
101 | buf->count -= reclen; | 104 | buf->count -= reclen; |
102 | return 0; | 105 | return 0; |
106 | Efault: | ||
107 | buf->error = -EFAULT; | ||
108 | return -EFAULT; | ||
103 | } | 109 | } |
104 | 110 | ||
105 | #undef NAME_OFFSET | 111 | #undef NAME_OFFSET |
@@ -126,8 +132,10 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i | |||
126 | error = buf.error; | 132 | error = buf.error; |
127 | lastdirent = buf.previous; | 133 | lastdirent = buf.previous; |
128 | if (lastdirent) { | 134 | if (lastdirent) { |
129 | put_user(file->f_pos, &lastdirent->d_off); | 135 | if (put_user(file->f_pos, &lastdirent->d_off)) |
130 | error = count - buf.count; | 136 | error = -EFAULT; |
137 | else | ||
138 | error = count - buf.count; | ||
131 | } | 139 | } |
132 | 140 | ||
133 | out_putf: | 141 | out_putf: |
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index fdacdd4341c9..44138c3e6ea7 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -47,7 +47,9 @@ | |||
47 | #include <linux/string.h> | 47 | #include <linux/string.h> |
48 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
49 | #include <linux/bug.h> | 49 | #include <linux/bug.h> |
50 | #include <linux/uaccess.h> | ||
50 | 51 | ||
52 | #include <asm/sections.h> | ||
51 | #include <asm/unwind.h> | 53 | #include <asm/unwind.h> |
52 | 54 | ||
53 | #if 0 | 55 | #if 0 |
@@ -860,3 +862,15 @@ void module_arch_cleanup(struct module *mod) | |||
860 | deregister_unwind_table(mod); | 862 | deregister_unwind_table(mod); |
861 | module_bug_cleanup(mod); | 863 | module_bug_cleanup(mod); |
862 | } | 864 | } |
865 | |||
866 | #ifdef CONFIG_64BIT | ||
867 | void *dereference_function_descriptor(void *ptr) | ||
868 | { | ||
869 | Elf64_Fdesc *desc = ptr; | ||
870 | void *p; | ||
871 | |||
872 | if (!probe_kernel_address(&desc->addr, p)) | ||
873 | ptr = p; | ||
874 | return ptr; | ||
875 | } | ||
876 | #endif | ||