git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
powerpc
/
kernel
/
sys_ppc32.c
diff --git
a/arch/powerpc/kernel/sys_ppc32.c
b/arch/powerpc/kernel/sys_ppc32.c
index
ec274e6
..
ad9dfcd
100644
(file)
--- a/
arch/powerpc/kernel/sys_ppc32.c
+++ b/
arch/powerpc/kernel/sys_ppc32.c
@@
-14,7
+14,6
@@
* 2 of the License, or (at your option) any later version.
*/
* 2 of the License, or (at your option) any later version.
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/fs.h>
@@
-52,6
+51,7
@@
#include <asm/time.h>
#include <asm/mmu_context.h>
#include <asm/ppc-pci.h>
#include <asm/time.h>
#include <asm/mmu_context.h>
#include <asm/ppc-pci.h>
+#include <asm/syscalls.h>
/* readdir & getdents */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
/* readdir & getdents */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
@@
-70,16
+70,20
@@
struct readdir_callback32 {
};
static int fillonedir(void * __buf, const char * name, int namlen,
};
static int fillonedir(void * __buf, const char * name, int namlen,
- off_t offset,
ino_t
ino, unsigned int d_type)
+ off_t offset,
u64
ino, unsigned int d_type)
{
struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf;
struct old_linux_dirent32 __user * dirent;
{
struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf;
struct old_linux_dirent32 __user * dirent;
+ ino_t d_ino;
if (buf->count)
return -EINVAL;
if (buf->count)
return -EINVAL;
+ d_ino = ino;
+ if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
+ return -EOVERFLOW;
buf->count++;
dirent = buf->dirent;
buf->count++;
dirent = buf->dirent;
- put_user(ino, &dirent->d_ino);
+ put_user(
d_
ino, &dirent->d_ino);
put_user(offset, &dirent->d_offset);
put_user(namlen, &dirent->d_namlen);
copy_to_user(dirent->d_name, name, namlen);
put_user(offset, &dirent->d_offset);
put_user(namlen, &dirent->d_namlen);
copy_to_user(dirent->d_name, name, namlen);
@@
-121,15
+125,20
@@
asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
{
int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
{
+ compat_ino_t ino;
long err;
if (stat->size > MAX_NON_LFS || !new_valid_dev(stat->dev) ||
!new_valid_dev(stat->rdev))
return -EOVERFLOW;
long err;
if (stat->size > MAX_NON_LFS || !new_valid_dev(stat->dev) ||
!new_valid_dev(stat->rdev))
return -EOVERFLOW;
+ ino = stat->ino;
+ if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino)
+ return -EOVERFLOW;
+
err = access_ok(VERIFY_WRITE, statbuf, sizeof(*statbuf)) ? 0 : -EFAULT;
err |= __put_user(new_encode_dev(stat->dev), &statbuf->st_dev);
err = access_ok(VERIFY_WRITE, statbuf, sizeof(*statbuf)) ? 0 : -EFAULT;
err |= __put_user(new_encode_dev(stat->dev), &statbuf->st_dev);
- err |= __put_user(
stat->
ino, &statbuf->st_ino);
+ err |= __put_user(ino, &statbuf->st_ino);
err |= __put_user(stat->mode, &statbuf->st_mode);
err |= __put_user(stat->nlink, &statbuf->st_nlink);
err |= __put_user(stat->uid, &statbuf->st_uid);
err |= __put_user(stat->mode, &statbuf->st_mode);
err |= __put_user(stat->nlink, &statbuf->st_nlink);
err |= __put_user(stat->uid, &statbuf->st_uid);
@@
-267,7
+276,7
@@
asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv, struct
{
if (tv) {
struct timeval ktv;
{
if (tv) {
struct timeval ktv;
-
do
_gettimeofday(&ktv);
+
vx
_gettimeofday(&ktv);
if (put_tv32(tv, &ktv))
return -EFAULT;
}
if (put_tv32(tv, &ktv))
return -EFAULT;
}
@@
-430,11
+439,6
@@
long compat_sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
- if (error == 0) {
- task_lock(current);
- current->ptrace &= ~PT_DTRACE;
- task_unlock(current);
- }
putname(filename);
out:
putname(filename);
out:
@@
-741,7
+745,7
@@
asmlinkage long compat_sys_umask(u32 mask)
return sys_umask((int)mask);
}
return sys_umask((int)mask);
}
-#ifdef CONFIG_SYSCTL
+#ifdef CONFIG_SYSCTL
_SYSCALL
struct __sysctl_args32 {
u32 name;
int nlen;
struct __sysctl_args32 {
u32 name;
int nlen;