Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24863
b: refs/heads/master
c: 4d338e1
h: refs/heads/master
i:
  24861: 1870501
  24859: 7e73bf6
  24855: 1635d39
  24847: 7e124a7
  24831: f349d84
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Mar 31, 2006
1 parent dee562f commit bbfb9e3
Show file tree
Hide file tree
Showing 17 changed files with 94 additions and 101 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 694a464e19b9e3278dbaf6a09fa7c1efec3f8eb5
refs/heads/master: 4d338e1accfc3473f7e453427dfd4f1ebf4dbbe6
8 changes: 4 additions & 4 deletions trunk/arch/um/drivers/harddog_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int harddog_release(struct inode *inode, struct file *file)

extern int ping_watchdog(int fd);

static ssize_t harddog_write(struct file *file, const char *data, size_t len,
static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
loff_t *ppos)
{
/*
Expand All @@ -118,6 +118,7 @@ static ssize_t harddog_write(struct file *file, const char *data, size_t len,
static int harddog_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
void __user *argp= (void __user *)arg;
static struct watchdog_info ident = {
WDIOC_SETTIMEOUT,
0,
Expand All @@ -127,13 +128,12 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
default:
return -ENOTTY;
case WDIOC_GETSUPPORT:
if(copy_to_user((struct harddog_info *)arg, &ident,
sizeof(ident)))
if(copy_to_user(argp, &ident, sizeof(ident)))
return -EFAULT;
return 0;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0,(int *)arg);
return put_user(0,(int __user *)argp);
case WDIOC_KEEPALIVE:
return(ping_watchdog(harddog_out_fd));
}
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/um/drivers/hostaudio_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);

/* /dev/dsp file operations */

static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count,
loff_t *ppos)
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
struct hostaudio_state *state = file->private_data;
void *kbuf;
Expand All @@ -94,7 +94,7 @@ static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count,
return(err);
}

static ssize_t hostaudio_write(struct file *file, const char *buffer,
static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
struct hostaudio_state *state = file->private_data;
Expand Down Expand Up @@ -152,7 +152,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
if(get_user(data, (int *) arg))
if(get_user(data, (int __user *) arg))
return(-EFAULT);
break;
default:
Expand All @@ -168,7 +168,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
if(put_user(data, (int *) arg))
if(put_user(data, (int __user *) arg))
return(-EFAULT);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/drivers/slirp_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int slirp_setup(char *str, char **mac_out, void *data)
int i=0;

*init = ((struct slirp_init)
{ argw : { { "slirp", NULL } } });
{ .argw = { { "slirp", NULL } } });

str = split_if_spec(str, mac_out, NULL);

Expand Down
18 changes: 6 additions & 12 deletions trunk/arch/um/include/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,17 @@ struct line {
};

#define LINE_INIT(str, d) \
{ init_str : str, \
init_pri : INIT_STATIC, \
valid : 1, \
throttled : 0, \
lock : SPIN_LOCK_UNLOCKED, \
buffer : NULL, \
head : NULL, \
tail : NULL, \
sigio : 0, \
driver : d, \
have_irq : 0 }
{ .init_str = str, \
.init_pri = INIT_STATIC, \
.valid = 1, \
.lock = SPIN_LOCK_UNLOCKED, \
.driver = d }

struct lines {
int num;
};

#define LINES_INIT(n) { num : n }
#define LINES_INIT(n) { .num = n }

extern void line_close(struct tty_struct *tty, struct file * filp);
extern int line_open(struct line *lines, struct tty_struct *tty);
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/um/include/sysdep-i386/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
*/

static __inline__
unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst,
unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
unsigned char *dst,
int len, int sum, int *err_ptr)
{
if(copy_from_user(dst, src, len)){
Expand Down Expand Up @@ -192,7 +193,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
*/
#define HAVE_CSUM_COPY_USER
static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
unsigned char *dst,
unsigned char __user *dst,
int len, int sum, int *err_ptr)
{
if (access_ok(VERIFY_WRITE, dst, len)){
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/kernel/exec_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
return(err);
}

long sys_execve(char *file, char __user *__user *argv,
long sys_execve(char __user *file, char __user *__user *argv,
char __user *__user *env)
{
long error;
char *filename;

lock_kernel();
filename = getname((char __user *) file);
filename = getname(file);
error = PTR_ERR(filename);
if (IS_ERR(filename)) goto out;
error = execve1(filename, argv, env);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/kernel/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int
return strlen(buf);
}

static int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data)
static int proc_write_sysemu(struct file *file,const char __user *buf, unsigned long count,void *data)
{
char tmp[2];

Expand Down
34 changes: 15 additions & 19 deletions trunk/arch/um/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern int poke_user(struct task_struct * child, long addr, long data);
long arch_ptrace(struct task_struct *child, long request, long addr, long data)
{
int i, ret;
unsigned long __user *p = (void __user *)(unsigned long)data;

switch (request) {
/* when I and D space are separate, these will need to be fixed. */
Expand All @@ -58,7 +59,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
if (copied != sizeof(tmp))
break;
ret = put_user(tmp, (unsigned long __user *) data);
ret = put_user(tmp, p);
break;
}

Expand Down Expand Up @@ -136,15 +137,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)

#ifdef PTRACE_GETREGS
case PTRACE_GETREGS: { /* Get all gp regs from the child. */
if (!access_ok(VERIFY_WRITE, (unsigned long *)data,
MAX_REG_OFFSET)) {
if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
ret = -EIO;
break;
}
for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
__put_user(getreg(child, i),
(unsigned long __user *) data);
data += sizeof(long);
__put_user(getreg(child, i), p);
p++;
}
ret = 0;
break;
Expand All @@ -153,15 +152,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
#ifdef PTRACE_SETREGS
case PTRACE_SETREGS: { /* Set all gp regs in the child. */
unsigned long tmp = 0;
if (!access_ok(VERIFY_READ, (unsigned *)data,
MAX_REG_OFFSET)) {
if (!access_ok(VERIFY_READ, p, MAX_REG_OFFSET)) {
ret = -EIO;
break;
}
for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
__get_user(tmp, (unsigned long __user *) data);
__get_user(tmp, p);
putreg(child, i, tmp);
data += sizeof(long);
p++;
}
ret = 0;
break;
Expand All @@ -188,13 +186,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
#endif
case PTRACE_FAULTINFO: {
/* Take the info from thread->arch->faultinfo,
* but transfer max. sizeof(struct ptrace_faultinfo).
* On i386, ptrace_faultinfo is smaller!
*/
ret = copy_to_user((unsigned long __user *) data,
&child->thread.arch.faultinfo,
sizeof(struct ptrace_faultinfo));
/* Take the info from thread->arch->faultinfo,
* but transfer max. sizeof(struct ptrace_faultinfo).
* On i386, ptrace_faultinfo is smaller!
*/
ret = copy_to_user(p, &child->thread.arch.faultinfo,
sizeof(struct ptrace_faultinfo));
if(ret)
break;
break;
Expand All @@ -204,8 +201,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
case PTRACE_LDT: {
struct ptrace_ldt ldt;

if(copy_from_user(&ldt, (unsigned long __user *) data,
sizeof(ldt))){
if(copy_from_user(&ldt, p, sizeof(ldt))){
ret = -EIO;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/kernel/syscall_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ long sys_pipe(unsigned long __user * fildes)
}


long sys_uname(struct old_utsname * name)
long sys_uname(struct old_utsname __user * name)
{
long err;
if (!name)
Expand All @@ -115,7 +115,7 @@ long sys_uname(struct old_utsname * name)
return err?-EFAULT:0;
}

long sys_olduname(struct oldold_utsname * name)
long sys_olduname(struct oldold_utsname __user * name)
{
long error;

Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/um/kernel/trap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
si.si_signo = SIGBUS;
si.si_errno = 0;
si.si_code = BUS_ADRERR;
si.si_addr = (void *)address;
si.si_addr = (void __user *)address;
current->thread.arch.faultinfo = fi;
force_sig_info(SIGBUS, &si, current);
} else if (err == -ENOMEM) {
Expand All @@ -207,7 +207,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
} else {
BUG_ON(err != -EFAULT);
si.si_signo = SIGSEGV;
si.si_addr = (void *) address;
si.si_addr = (void __user *) address;
current->thread.arch.faultinfo = fi;
force_sig_info(SIGSEGV, &si, current);
}
Expand All @@ -220,8 +220,8 @@ void bad_segv(struct faultinfo fi, unsigned long ip)

si.si_signo = SIGSEGV;
si.si_code = SEGV_ACCERR;
si.si_addr = (void *) FAULT_ADDRESS(fi);
current->thread.arch.faultinfo = fi;
si.si_addr = (void __user *) FAULT_ADDRESS(fi);
current->thread.arch.faultinfo = fi;
force_sig_info(SIGSEGV, &si, current);
}

Expand Down
28 changes: 14 additions & 14 deletions trunk/arch/um/sys-i386/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ unsigned long getreg(struct task_struct *child, int regno)
int peek_user(struct task_struct *child, long addr, long data)
{
/* read the word at location addr in the USER area. */
unsigned long tmp;
unsigned long tmp;

if ((addr & 3) || addr < 0)
return -EIO;
if ((addr & 3) || addr < 0)
return -EIO;

tmp = 0; /* Default return condition */
if(addr < MAX_REG_OFFSET){
tmp = getreg(child, addr);
}
else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2;
tmp = child->thread.arch.debugregs[addr];
}
return put_user(tmp, (unsigned long *) data);
tmp = 0; /* Default return condition */
if(addr < MAX_REG_OFFSET){
tmp = getreg(child, addr);
}
else if((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))){
addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2;
tmp = child->thread.arch.debugregs[addr];
}
return put_user(tmp, (unsigned long __user *) data);
}

struct i387_fxsave_struct {
Expand Down
Loading

0 comments on commit bbfb9e3

Please sign in to comment.