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
Kirill Smelkov
linux
Commits
29e646df
Commit
29e646df
authored
Feb 01, 2006
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] powerpc signal __user annotations
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5b1a43d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_32.c
+7
-11
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/signal_64.c
+2
-2
include/asm-powerpc/compat.h
include/asm-powerpc/compat.h
+5
-0
No files found.
arch/powerpc/kernel/signal_32.c
View file @
29e646df
...
@@ -142,11 +142,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
...
@@ -142,11 +142,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
return
0
;
return
0
;
}
}
static
inline
compat_uptr_t
to_user_ptr
(
void
*
kp
)
#define to_user_ptr(p) ptr_to_compat(p)
{
return
(
compat_uptr_t
)(
u64
)
kp
;
}
#define from_user_ptr(p) compat_ptr(p)
#define from_user_ptr(p) compat_ptr(p)
static
inline
int
save_general_regs
(
struct
pt_regs
*
regs
,
static
inline
int
save_general_regs
(
struct
pt_regs
*
regs
,
...
@@ -213,8 +209,8 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
...
@@ -213,8 +209,8 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
return
0
;
return
0
;
}
}
#define to_user_ptr(p) (
p
)
#define to_user_ptr(p) (
(unsigned long)(p)
)
#define from_user_ptr(p) (
p
)
#define from_user_ptr(p) (
(void __user *)(p)
)
static
inline
int
save_general_regs
(
struct
pt_regs
*
regs
,
static
inline
int
save_general_regs
(
struct
pt_regs
*
regs
,
struct
mcontext
__user
*
frame
)
struct
mcontext
__user
*
frame
)
...
@@ -526,7 +522,7 @@ long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act,
...
@@ -526,7 +522,7 @@ long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act,
ret
=
do_sigaction
(
sig
,
act
?
&
new_ka
:
NULL
,
oact
?
&
old_ka
:
NULL
);
ret
=
do_sigaction
(
sig
,
act
?
&
new_ka
:
NULL
,
oact
?
&
old_ka
:
NULL
);
if
(
!
ret
&&
oact
)
{
if
(
!
ret
&&
oact
)
{
ret
=
put_user
(
(
long
)
old_ka
.
sa
.
sa_handler
,
&
oact
->
sa_handler
);
ret
=
put_user
(
to_user_ptr
(
old_ka
.
sa
.
sa_handler
)
,
&
oact
->
sa_handler
);
ret
|=
put_sigset_t
(
&
oact
->
sa_mask
,
&
old_ka
.
sa
.
sa_mask
);
ret
|=
put_sigset_t
(
&
oact
->
sa_mask
,
&
old_ka
.
sa
.
sa_mask
);
ret
|=
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
ret
|=
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
}
}
...
@@ -675,8 +671,8 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo
...
@@ -675,8 +671,8 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo
int
compat_sys_sigaltstack
(
u32
__new
,
u32
__old
,
int
r5
,
int
compat_sys_sigaltstack
(
u32
__new
,
u32
__old
,
int
r5
,
int
r6
,
int
r7
,
int
r8
,
struct
pt_regs
*
regs
)
int
r6
,
int
r7
,
int
r8
,
struct
pt_regs
*
regs
)
{
{
stack_32_t
__user
*
newstack
=
(
stack_32_t
__user
*
)(
long
)
__new
;
stack_32_t
__user
*
newstack
=
compat_ptr
(
__new
)
;
stack_32_t
__user
*
oldstack
=
(
stack_32_t
__user
*
)(
long
)
__old
;
stack_32_t
__user
*
oldstack
=
compat_ptr
(
__old
)
;
stack_t
uss
,
uoss
;
stack_t
uss
,
uoss
;
int
ret
;
int
ret
;
mm_segment_t
old_fs
;
mm_segment_t
old_fs
;
...
@@ -708,7 +704,7 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
...
@@ -708,7 +704,7 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
set_fs
(
old_fs
);
set_fs
(
old_fs
);
/* Copy the stack information to the user output buffer */
/* Copy the stack information to the user output buffer */
if
(
!
ret
&&
oldstack
&&
if
(
!
ret
&&
oldstack
&&
(
put_user
(
(
long
)
uoss
.
ss_sp
,
&
oldstack
->
ss_sp
)
||
(
put_user
(
ptr_to_compat
(
uoss
.
ss_sp
)
,
&
oldstack
->
ss_sp
)
||
__put_user
(
uoss
.
ss_flags
,
&
oldstack
->
ss_flags
)
||
__put_user
(
uoss
.
ss_flags
,
&
oldstack
->
ss_flags
)
||
__put_user
(
uoss
.
ss_size
,
&
oldstack
->
ss_size
)))
__put_user
(
uoss
.
ss_size
,
&
oldstack
->
ss_size
)))
return
-
EFAULT
;
return
-
EFAULT
;
...
...
arch/powerpc/kernel/signal_64.c
View file @
29e646df
...
@@ -60,8 +60,8 @@ struct rt_sigframe {
...
@@ -60,8 +60,8 @@ struct rt_sigframe {
struct
ucontext
uc
;
struct
ucontext
uc
;
unsigned
long
_unused
[
2
];
unsigned
long
_unused
[
2
];
unsigned
int
tramp
[
TRAMP_SIZE
];
unsigned
int
tramp
[
TRAMP_SIZE
];
struct
siginfo
*
pinfo
;
struct
siginfo
__user
*
pinfo
;
void
*
puc
;
void
__user
*
puc
;
struct
siginfo
info
;
struct
siginfo
info
;
/* 64 bit ABI allows for 288 bytes below sp before decrementing it. */
/* 64 bit ABI allows for 288 bytes below sp before decrementing it. */
char
abigap
[
288
];
char
abigap
[
288
];
...
...
include/asm-powerpc/compat.h
View file @
29e646df
...
@@ -126,6 +126,11 @@ static inline void __user *compat_ptr(compat_uptr_t uptr)
...
@@ -126,6 +126,11 @@ static inline void __user *compat_ptr(compat_uptr_t uptr)
return
(
void
__user
*
)(
unsigned
long
)
uptr
;
return
(
void
__user
*
)(
unsigned
long
)
uptr
;
}
}
static
inline
compat_uptr_t
ptr_to_compat
(
void
__user
*
uptr
)
{
return
(
u32
)(
unsigned
long
)
uptr
;
}
static
inline
void
__user
*
compat_alloc_user_space
(
long
len
)
static
inline
void
__user
*
compat_alloc_user_space
(
long
len
)
{
{
struct
pt_regs
*
regs
=
current
->
thread
.
regs
;
struct
pt_regs
*
regs
=
current
->
thread
.
regs
;
...
...
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