Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6819f2cb
Commit
6819f2cb
authored
Apr 17, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Add __user address space identifiers for sparse.
parent
859f08ee
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
63 deletions
+65
-63
arch/arm/kernel/ptrace.c
arch/arm/kernel/ptrace.c
+10
-10
arch/arm/kernel/signal.c
arch/arm/kernel/signal.c
+16
-16
arch/arm/kernel/sys_arm.c
arch/arm/kernel/sys_arm.c
+22
-20
arch/arm/mm/alignment.c
arch/arm/mm/alignment.c
+2
-2
include/asm-arm/uaccess.h
include/asm-arm/uaccess.h
+15
-15
No files found.
arch/arm/kernel/ptrace.c
View file @
6819f2cb
...
@@ -526,7 +526,7 @@ core_initcall(ptrace_break_init);
...
@@ -526,7 +526,7 @@ core_initcall(ptrace_break_init);
* actually access the pt_regs stored on the kernel stack.
* actually access the pt_regs stored on the kernel stack.
*/
*/
static
int
ptrace_read_user
(
struct
task_struct
*
tsk
,
unsigned
long
off
,
static
int
ptrace_read_user
(
struct
task_struct
*
tsk
,
unsigned
long
off
,
unsigned
long
*
ret
)
unsigned
long
__user
*
ret
)
{
{
unsigned
long
tmp
;
unsigned
long
tmp
;
...
@@ -559,7 +559,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
...
@@ -559,7 +559,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
/*
/*
* Get all user integer registers.
* Get all user integer registers.
*/
*/
static
int
ptrace_getregs
(
struct
task_struct
*
tsk
,
void
*
uregs
)
static
int
ptrace_getregs
(
struct
task_struct
*
tsk
,
void
__user
*
uregs
)
{
{
struct
pt_regs
*
regs
=
get_user_regs
(
tsk
);
struct
pt_regs
*
regs
=
get_user_regs
(
tsk
);
...
@@ -569,7 +569,7 @@ static int ptrace_getregs(struct task_struct *tsk, void *uregs)
...
@@ -569,7 +569,7 @@ static int ptrace_getregs(struct task_struct *tsk, void *uregs)
/*
/*
* Set all user integer registers.
* Set all user integer registers.
*/
*/
static
int
ptrace_setregs
(
struct
task_struct
*
tsk
,
void
*
uregs
)
static
int
ptrace_setregs
(
struct
task_struct
*
tsk
,
void
__user
*
uregs
)
{
{
struct
pt_regs
newregs
;
struct
pt_regs
newregs
;
int
ret
;
int
ret
;
...
@@ -591,7 +591,7 @@ static int ptrace_setregs(struct task_struct *tsk, void *uregs)
...
@@ -591,7 +591,7 @@ static int ptrace_setregs(struct task_struct *tsk, void *uregs)
/*
/*
* Get the child FPU state.
* Get the child FPU state.
*/
*/
static
int
ptrace_getfpregs
(
struct
task_struct
*
tsk
,
void
*
ufp
)
static
int
ptrace_getfpregs
(
struct
task_struct
*
tsk
,
void
__user
*
ufp
)
{
{
return
copy_to_user
(
ufp
,
&
tsk
->
thread_info
->
fpstate
,
return
copy_to_user
(
ufp
,
&
tsk
->
thread_info
->
fpstate
,
sizeof
(
struct
user_fp
))
?
-
EFAULT
:
0
;
sizeof
(
struct
user_fp
))
?
-
EFAULT
:
0
;
...
@@ -600,7 +600,7 @@ static int ptrace_getfpregs(struct task_struct *tsk, void *ufp)
...
@@ -600,7 +600,7 @@ static int ptrace_getfpregs(struct task_struct *tsk, void *ufp)
/*
/*
* Set the child FPU state.
* Set the child FPU state.
*/
*/
static
int
ptrace_setfpregs
(
struct
task_struct
*
tsk
,
void
*
ufp
)
static
int
ptrace_setfpregs
(
struct
task_struct
*
tsk
,
void
__user
*
ufp
)
{
{
struct
thread_info
*
thread
=
tsk
->
thread_info
;
struct
thread_info
*
thread
=
tsk
->
thread_info
;
thread
->
used_cp
[
1
]
=
thread
->
used_cp
[
2
]
=
1
;
thread
->
used_cp
[
1
]
=
thread
->
used_cp
[
2
]
=
1
;
...
@@ -628,7 +628,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
...
@@ -628,7 +628,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
break
;
break
;
case
PTRACE_PEEKUSR
:
case
PTRACE_PEEKUSR
:
ret
=
ptrace_read_user
(
child
,
addr
,
(
unsigned
long
*
)
data
);
ret
=
ptrace_read_user
(
child
,
addr
,
(
unsigned
long
__user
*
)
data
);
break
;
break
;
/*
/*
...
@@ -704,19 +704,19 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
...
@@ -704,19 +704,19 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
break
;
break
;
case
PTRACE_GETREGS
:
case
PTRACE_GETREGS
:
ret
=
ptrace_getregs
(
child
,
(
void
*
)
data
);
ret
=
ptrace_getregs
(
child
,
(
void
__user
*
)
data
);
break
;
break
;
case
PTRACE_SETREGS
:
case
PTRACE_SETREGS
:
ret
=
ptrace_setregs
(
child
,
(
void
*
)
data
);
ret
=
ptrace_setregs
(
child
,
(
void
__user
*
)
data
);
break
;
break
;
case
PTRACE_GETFPREGS
:
case
PTRACE_GETFPREGS
:
ret
=
ptrace_getfpregs
(
child
,
(
void
*
)
data
);
ret
=
ptrace_getfpregs
(
child
,
(
void
__user
*
)
data
);
break
;
break
;
case
PTRACE_SETFPREGS
:
case
PTRACE_SETFPREGS
:
ret
=
ptrace_setfpregs
(
child
,
(
void
*
)
data
);
ret
=
ptrace_setfpregs
(
child
,
(
void
__user
*
)
data
);
break
;
break
;
default:
default:
...
...
arch/arm/kernel/signal.c
View file @
6819f2cb
...
@@ -76,7 +76,7 @@ asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t m
...
@@ -76,7 +76,7 @@ asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t m
}
}
asmlinkage
int
asmlinkage
int
sys_rt_sigsuspend
(
sigset_t
*
unewset
,
size_t
sigsetsize
,
struct
pt_regs
*
regs
)
sys_rt_sigsuspend
(
sigset_t
__user
*
unewset
,
size_t
sigsetsize
,
struct
pt_regs
*
regs
)
{
{
sigset_t
saveset
,
newset
;
sigset_t
saveset
,
newset
;
...
@@ -104,8 +104,8 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs *regs)
...
@@ -104,8 +104,8 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs *regs)
}
}
asmlinkage
int
asmlinkage
int
sys_sigaction
(
int
sig
,
const
struct
old_sigaction
*
act
,
sys_sigaction
(
int
sig
,
const
struct
old_sigaction
__user
*
act
,
struct
old_sigaction
*
oact
)
struct
old_sigaction
__user
*
oact
)
{
{
struct
k_sigaction
new_ka
,
old_ka
;
struct
k_sigaction
new_ka
,
old_ka
;
int
ret
;
int
ret
;
...
@@ -147,15 +147,15 @@ struct sigframe
...
@@ -147,15 +147,15 @@ struct sigframe
struct
rt_sigframe
struct
rt_sigframe
{
{
struct
siginfo
*
pinfo
;
struct
siginfo
__user
*
pinfo
;
void
*
puc
;
void
__user
*
puc
;
struct
siginfo
info
;
struct
siginfo
info
;
struct
ucontext
uc
;
struct
ucontext
uc
;
unsigned
long
retcode
;
unsigned
long
retcode
;
};
};
static
int
static
int
restore_sigcontext
(
struct
pt_regs
*
regs
,
struct
sigcontext
*
sc
)
restore_sigcontext
(
struct
pt_regs
*
regs
,
struct
sigcontext
__user
*
sc
)
{
{
int
err
=
0
;
int
err
=
0
;
...
@@ -184,7 +184,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
...
@@ -184,7 +184,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
asmlinkage
int
sys_sigreturn
(
struct
pt_regs
*
regs
)
asmlinkage
int
sys_sigreturn
(
struct
pt_regs
*
regs
)
{
{
struct
sigframe
*
frame
;
struct
sigframe
__user
*
frame
;
sigset_t
set
;
sigset_t
set
;
/* Always make any pending restarted system calls return -EINTR */
/* Always make any pending restarted system calls return -EINTR */
...
@@ -198,7 +198,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
...
@@ -198,7 +198,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
if
(
regs
->
ARM_sp
&
7
)
if
(
regs
->
ARM_sp
&
7
)
goto
badframe
;
goto
badframe
;
frame
=
(
struct
sigframe
*
)
regs
->
ARM_sp
;
frame
=
(
struct
sigframe
__user
*
)
regs
->
ARM_sp
;
if
(
verify_area
(
VERIFY_READ
,
frame
,
sizeof
(
*
frame
)))
if
(
verify_area
(
VERIFY_READ
,
frame
,
sizeof
(
*
frame
)))
goto
badframe
;
goto
badframe
;
...
@@ -232,7 +232,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
...
@@ -232,7 +232,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
asmlinkage
int
sys_rt_sigreturn
(
struct
pt_regs
*
regs
)
asmlinkage
int
sys_rt_sigreturn
(
struct
pt_regs
*
regs
)
{
{
struct
rt_sigframe
*
frame
;
struct
rt_sigframe
__user
*
frame
;
sigset_t
set
;
sigset_t
set
;
/* Always make any pending restarted system calls return -EINTR */
/* Always make any pending restarted system calls return -EINTR */
...
@@ -246,7 +246,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
...
@@ -246,7 +246,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
if
(
regs
->
ARM_sp
&
7
)
if
(
regs
->
ARM_sp
&
7
)
goto
badframe
;
goto
badframe
;
frame
=
(
struct
rt_sigframe
*
)
regs
->
ARM_sp
;
frame
=
(
struct
rt_sigframe
__user
*
)
regs
->
ARM_sp
;
if
(
verify_area
(
VERIFY_READ
,
frame
,
sizeof
(
*
frame
)))
if
(
verify_area
(
VERIFY_READ
,
frame
,
sizeof
(
*
frame
)))
goto
badframe
;
goto
badframe
;
...
@@ -276,7 +276,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
...
@@ -276,7 +276,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
}
}
static
int
static
int
setup_sigcontext
(
struct
sigcontext
*
sc
,
/*struct _fpstate *fpstate,*/
setup_sigcontext
(
struct
sigcontext
__user
*
sc
,
/*struct _fpstate *fpstate,*/
struct
pt_regs
*
regs
,
unsigned
long
mask
)
struct
pt_regs
*
regs
,
unsigned
long
mask
)
{
{
int
err
=
0
;
int
err
=
0
;
...
@@ -307,7 +307,7 @@ setup_sigcontext(struct sigcontext *sc, /*struct _fpstate *fpstate,*/
...
@@ -307,7 +307,7 @@ setup_sigcontext(struct sigcontext *sc, /*struct _fpstate *fpstate,*/
return
err
;
return
err
;
}
}
static
inline
void
*
static
inline
void
__user
*
get_sigframe
(
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
,
int
framesize
)
get_sigframe
(
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
,
int
framesize
)
{
{
unsigned
long
sp
=
regs
->
ARM_sp
;
unsigned
long
sp
=
regs
->
ARM_sp
;
...
@@ -321,12 +321,12 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize)
...
@@ -321,12 +321,12 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize)
/*
/*
* ATPCS B01 mandates 8-byte alignment
* ATPCS B01 mandates 8-byte alignment
*/
*/
return
(
void
*
)((
sp
-
framesize
)
&
~
7
);
return
(
void
__user
*
)((
sp
-
framesize
)
&
~
7
);
}
}
static
int
static
int
setup_return
(
struct
pt_regs
*
regs
,
struct
k_sigaction
*
ka
,
setup_return
(
struct
pt_regs
*
regs
,
struct
k_sigaction
*
ka
,
unsigned
long
*
rc
,
void
*
frame
,
int
usig
)
unsigned
long
__user
*
rc
,
void
__user
*
frame
,
int
usig
)
{
{
unsigned
long
handler
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
unsigned
long
handler
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
unsigned
long
retcode
;
unsigned
long
retcode
;
...
@@ -387,7 +387,7 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
...
@@ -387,7 +387,7 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
static
int
static
int
setup_frame
(
int
usig
,
struct
k_sigaction
*
ka
,
sigset_t
*
set
,
struct
pt_regs
*
regs
)
setup_frame
(
int
usig
,
struct
k_sigaction
*
ka
,
sigset_t
*
set
,
struct
pt_regs
*
regs
)
{
{
struct
sigframe
*
frame
=
get_sigframe
(
ka
,
regs
,
sizeof
(
*
frame
));
struct
sigframe
__user
*
frame
=
get_sigframe
(
ka
,
regs
,
sizeof
(
*
frame
));
int
err
=
0
;
int
err
=
0
;
if
(
!
access_ok
(
VERIFY_WRITE
,
frame
,
sizeof
(
*
frame
)))
if
(
!
access_ok
(
VERIFY_WRITE
,
frame
,
sizeof
(
*
frame
)))
...
@@ -410,7 +410,7 @@ static int
...
@@ -410,7 +410,7 @@ static int
setup_rt_frame
(
int
usig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
setup_rt_frame
(
int
usig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
sigset_t
*
set
,
struct
pt_regs
*
regs
)
sigset_t
*
set
,
struct
pt_regs
*
regs
)
{
{
struct
rt_sigframe
*
frame
=
get_sigframe
(
ka
,
regs
,
sizeof
(
*
frame
));
struct
rt_sigframe
__user
*
frame
=
get_sigframe
(
ka
,
regs
,
sizeof
(
*
frame
));
int
err
=
0
;
int
err
=
0
;
if
(
!
access_ok
(
VERIFY_WRITE
,
frame
,
sizeof
(
*
frame
)))
if
(
!
access_ok
(
VERIFY_WRITE
,
frame
,
sizeof
(
*
frame
)))
...
...
arch/arm/kernel/sys_arm.c
View file @
6819f2cb
...
@@ -37,7 +37,7 @@ extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
...
@@ -37,7 +37,7 @@ extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
* sys_pipe() is the normal C calling standard for creating
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though.
* a pipe. It's not the way unix traditionally does this, though.
*/
*/
asmlinkage
int
sys_pipe
(
unsigned
long
*
fildes
)
asmlinkage
int
sys_pipe
(
unsigned
long
__user
*
fildes
)
{
{
int
fd
[
2
];
int
fd
[
2
];
int
error
;
int
error
;
...
@@ -94,7 +94,7 @@ struct mmap_arg_struct {
...
@@ -94,7 +94,7 @@ struct mmap_arg_struct {
unsigned
long
offset
;
unsigned
long
offset
;
};
};
asmlinkage
int
old_mmap
(
struct
mmap_arg_struct
*
arg
)
asmlinkage
int
old_mmap
(
struct
mmap_arg_struct
__user
*
arg
)
{
{
int
error
=
-
EFAULT
;
int
error
=
-
EFAULT
;
struct
mmap_arg_struct
a
;
struct
mmap_arg_struct
a
;
...
@@ -141,11 +141,11 @@ sys_arm_mremap(unsigned long addr, unsigned long old_len,
...
@@ -141,11 +141,11 @@ sys_arm_mremap(unsigned long addr, unsigned long old_len,
struct
sel_arg_struct
{
struct
sel_arg_struct
{
unsigned
long
n
;
unsigned
long
n
;
fd_set
*
inp
,
*
outp
,
*
exp
;
fd_set
__user
*
inp
,
*
outp
,
*
exp
;
struct
timeval
*
tvp
;
struct
timeval
__user
*
tvp
;
};
};
asmlinkage
int
old_select
(
struct
sel_arg_struct
*
arg
)
asmlinkage
int
old_select
(
struct
sel_arg_struct
__user
*
arg
)
{
{
struct
sel_arg_struct
a
;
struct
sel_arg_struct
a
;
...
@@ -160,7 +160,8 @@ asmlinkage int old_select(struct sel_arg_struct *arg)
...
@@ -160,7 +160,8 @@ asmlinkage int old_select(struct sel_arg_struct *arg)
*
*
* This is really horribly ugly.
* This is really horribly ugly.
*/
*/
asmlinkage
int
sys_ipc
(
uint
call
,
int
first
,
int
second
,
int
third
,
void
*
ptr
,
long
fifth
)
asmlinkage
int
sys_ipc
(
uint
call
,
int
first
,
int
second
,
int
third
,
void
__user
*
ptr
,
long
fifth
)
{
{
int
version
,
ret
;
int
version
,
ret
;
...
@@ -169,20 +170,20 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
...
@@ -169,20 +170,20 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
switch
(
call
)
{
switch
(
call
)
{
case
SEMOP
:
case
SEMOP
:
return
sys_semop
(
first
,
(
struct
sembuf
*
)
ptr
,
second
);
return
sys_semop
(
first
,
(
struct
sembuf
__user
*
)
ptr
,
second
);
case
SEMGET
:
case
SEMGET
:
return
sys_semget
(
first
,
second
,
third
);
return
sys_semget
(
first
,
second
,
third
);
case
SEMCTL
:
{
case
SEMCTL
:
{
union
semun
fourth
;
union
semun
fourth
;
if
(
!
ptr
)
if
(
!
ptr
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
get_user
(
fourth
.
__pad
,
(
void
**
)
ptr
))
if
(
get_user
(
fourth
.
__pad
,
(
void
__user
**
)
ptr
))
return
-
EFAULT
;
return
-
EFAULT
;
return
sys_semctl
(
first
,
second
,
third
,
fourth
);
return
sys_semctl
(
first
,
second
,
third
,
fourth
);
}
}
case
MSGSND
:
case
MSGSND
:
return
sys_msgsnd
(
first
,
(
struct
msgbuf
*
)
ptr
,
return
sys_msgsnd
(
first
,
(
struct
msgbuf
__user
*
)
ptr
,
second
,
third
);
second
,
third
);
case
MSGRCV
:
case
MSGRCV
:
switch
(
version
)
{
switch
(
version
)
{
...
@@ -190,7 +191,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
...
@@ -190,7 +191,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
struct
ipc_kludge
tmp
;
struct
ipc_kludge
tmp
;
if
(
!
ptr
)
if
(
!
ptr
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
copy_from_user
(
&
tmp
,(
struct
ipc_kludge
*
)
ptr
,
if
(
copy_from_user
(
&
tmp
,(
struct
ipc_kludge
__user
*
)
ptr
,
sizeof
(
tmp
)))
sizeof
(
tmp
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
sys_msgrcv
(
first
,
tmp
.
msgp
,
second
,
return
sys_msgrcv
(
first
,
tmp
.
msgp
,
second
,
...
@@ -198,36 +199,36 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
...
@@ -198,36 +199,36 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
}
}
default:
default:
return
sys_msgrcv
(
first
,
return
sys_msgrcv
(
first
,
(
struct
msgbuf
*
)
ptr
,
(
struct
msgbuf
__user
*
)
ptr
,
second
,
fifth
,
third
);
second
,
fifth
,
third
);
}
}
case
MSGGET
:
case
MSGGET
:
return
sys_msgget
((
key_t
)
first
,
second
);
return
sys_msgget
((
key_t
)
first
,
second
);
case
MSGCTL
:
case
MSGCTL
:
return
sys_msgctl
(
first
,
second
,
(
struct
msqid_ds
*
)
ptr
);
return
sys_msgctl
(
first
,
second
,
(
struct
msqid_ds
__user
*
)
ptr
);
case
SHMAT
:
case
SHMAT
:
switch
(
version
)
{
switch
(
version
)
{
default:
{
default:
{
ulong
raddr
;
ulong
raddr
;
ret
=
do_shmat
(
first
,
(
char
*
)
ptr
,
second
,
&
raddr
);
ret
=
do_shmat
(
first
,
(
char
__user
*
)
ptr
,
second
,
&
raddr
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
return
put_user
(
raddr
,
(
ulong
*
)
third
);
return
put_user
(
raddr
,
(
ulong
__user
*
)
third
);
}
}
case
1
:
/* iBCS2 emulator entry point */
case
1
:
/* iBCS2 emulator entry point */
if
(
!
segment_eq
(
get_fs
(),
get_ds
()))
if
(
!
segment_eq
(
get_fs
(),
get_ds
()))
return
-
EINVAL
;
return
-
EINVAL
;
return
do_shmat
(
first
,
(
cha
r
*
)
ptr
,
return
do_shmat
(
first
,
(
char
__use
r
*
)
ptr
,
second
,
(
ulong
*
)
third
);
second
,
(
ulong
__user
*
)
third
);
}
}
case
SHMDT
:
case
SHMDT
:
return
sys_shmdt
((
char
*
)
ptr
);
return
sys_shmdt
((
char
__user
*
)
ptr
);
case
SHMGET
:
case
SHMGET
:
return
sys_shmget
(
first
,
second
,
third
);
return
sys_shmget
(
first
,
second
,
third
);
case
SHMCTL
:
case
SHMCTL
:
return
sys_shmctl
(
first
,
second
,
return
sys_shmctl
(
first
,
second
,
(
struct
shmid_ds
*
)
ptr
);
(
struct
shmid_ds
__user
*
)
ptr
);
default:
default:
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
@@ -266,7 +267,8 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
...
@@ -266,7 +267,8 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
/* sys_execve() executes a new program.
/* sys_execve() executes a new program.
* This is called indirectly via a small wrapper
* This is called indirectly via a small wrapper
*/
*/
asmlinkage
int
sys_execve
(
char
*
filenamei
,
char
**
argv
,
char
**
envp
,
struct
pt_regs
*
regs
)
asmlinkage
int
sys_execve
(
char
__user
*
filenamei
,
char
__user
*
__user
*
argv
,
char
__user
*
__user
*
envp
,
struct
pt_regs
*
regs
)
{
{
int
error
;
int
error
;
char
*
filename
;
char
*
filename
;
...
...
arch/arm/mm/alignment.c
View file @
6819f2cb
...
@@ -112,10 +112,10 @@ proc_alignment_read(char *page, char **start, off_t off, int count, int *eof,
...
@@ -112,10 +112,10 @@ proc_alignment_read(char *page, char **start, off_t off, int count, int *eof,
return
len
;
return
len
;
}
}
static
int
proc_alignment_write
(
struct
file
*
file
,
const
char
*
buffer
,
static
int
proc_alignment_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
unsigned
long
count
,
void
*
data
)
unsigned
long
count
,
void
*
data
)
{
{
int
mode
;
char
mode
;
if
(
count
>
0
)
{
if
(
count
>
0
)
{
if
(
get_user
(
mode
,
buffer
))
if
(
get_user
(
mode
,
buffer
))
...
...
include/asm-arm/uaccess.h
View file @
6819f2cb
...
@@ -75,7 +75,7 @@ static inline void set_fs (mm_segment_t fs)
...
@@ -75,7 +75,7 @@ static inline void set_fs (mm_segment_t fs)
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
static
inline
int
verify_area
(
int
type
,
const
void
*
addr
,
unsigned
long
size
)
static
inline
int
verify_area
(
int
type
,
const
void
__user
*
addr
,
unsigned
long
size
)
{
{
return
access_ok
(
type
,
addr
,
size
)
?
0
:
-
EFAULT
;
return
access_ok
(
type
,
addr
,
size
)
?
0
:
-
EFAULT
;
}
}
...
@@ -354,13 +354,13 @@ do { \
...
@@ -354,13 +354,13 @@ do { \
: "r" (x), "i" (-EFAULT) \
: "r" (x), "i" (-EFAULT) \
: "cc")
: "cc")
extern
unsigned
long
__arch_copy_from_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
);
extern
unsigned
long
__arch_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
);
extern
unsigned
long
__arch_copy_to_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
);
extern
unsigned
long
__arch_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
);
extern
unsigned
long
__arch_clear_user
(
void
*
addr
,
unsigned
long
n
);
extern
unsigned
long
__arch_clear_user
(
void
__user
*
addr
,
unsigned
long
n
);
extern
unsigned
long
__arch_strncpy_from_user
(
char
*
to
,
const
char
*
from
,
unsigned
long
count
);
extern
unsigned
long
__arch_strncpy_from_user
(
char
*
to
,
const
char
__user
*
from
,
unsigned
long
count
);
extern
unsigned
long
__arch_strnlen_user
(
const
char
*
s
,
long
n
);
extern
unsigned
long
__arch_strnlen_user
(
const
char
__user
*
s
,
long
n
);
static
__inline__
unsigned
long
copy_from_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
{
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
n
=
__arch_copy_from_user
(
to
,
from
,
n
);
n
=
__arch_copy_from_user
(
to
,
from
,
n
);
...
@@ -369,36 +369,36 @@ static __inline__ unsigned long copy_from_user(void *to, const void *from, unsig
...
@@ -369,36 +369,36 @@ static __inline__ unsigned long copy_from_user(void *to, const void *from, unsig
return
n
;
return
n
;
}
}
static
__inline__
unsigned
long
__copy_from_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
__copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
{
return
__arch_copy_from_user
(
to
,
from
,
n
);
return
__arch_copy_from_user
(
to
,
from
,
n
);
}
}
static
__inline__
unsigned
long
copy_to_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
{
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
n
=
__arch_copy_to_user
(
to
,
from
,
n
);
n
=
__arch_copy_to_user
(
to
,
from
,
n
);
return
n
;
return
n
;
}
}
static
__inline__
unsigned
long
__copy_to_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
__copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
{
return
__arch_copy_to_user
(
to
,
from
,
n
);
return
__arch_copy_to_user
(
to
,
from
,
n
);
}
}
static
__inline__
unsigned
long
clear_user
(
void
*
to
,
unsigned
long
n
)
static
inline
unsigned
long
clear_user
(
void
__user
*
to
,
unsigned
long
n
)
{
{
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
n
=
__arch_clear_user
(
to
,
n
);
n
=
__arch_clear_user
(
to
,
n
);
return
n
;
return
n
;
}
}
static
__inline__
unsigned
long
__clear_user
(
void
*
to
,
unsigned
long
n
)
static
inline
unsigned
long
__clear_user
(
void
__user
*
to
,
unsigned
long
n
)
{
{
return
__arch_clear_user
(
to
,
n
);
return
__arch_clear_user
(
to
,
n
);
}
}
static
__inline__
long
strncpy_from_user
(
char
*
dst
,
const
cha
r
*
src
,
long
count
)
static
inline
long
strncpy_from_user
(
char
*
dst
,
const
char
__use
r
*
src
,
long
count
)
{
{
long
res
=
-
EFAULT
;
long
res
=
-
EFAULT
;
if
(
access_ok
(
VERIFY_READ
,
src
,
1
))
if
(
access_ok
(
VERIFY_READ
,
src
,
1
))
...
@@ -406,14 +406,14 @@ static __inline__ long strncpy_from_user (char *dst, const char *src, long count
...
@@ -406,14 +406,14 @@ static __inline__ long strncpy_from_user (char *dst, const char *src, long count
return
res
;
return
res
;
}
}
static
__inline__
long
__strncpy_from_user
(
char
*
dst
,
const
cha
r
*
src
,
long
count
)
static
inline
long
__strncpy_from_user
(
char
*
dst
,
const
char
__use
r
*
src
,
long
count
)
{
{
return
__arch_strncpy_from_user
(
dst
,
src
,
count
);
return
__arch_strncpy_from_user
(
dst
,
src
,
count
);
}
}
#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
static
inline
long
strnlen_user
(
const
char
*
s
,
long
n
)
static
inline
long
strnlen_user
(
const
char
__user
*
s
,
long
n
)
{
{
unsigned
long
res
=
0
;
unsigned
long
res
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment