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
c60a03fe
Commit
c60a03fe
authored
Sep 04, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s390: switch to {get,put}_compat_sigset()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
a5ae754a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
26 deletions
+7
-26
arch/s390/kernel/compat_signal.c
arch/s390/kernel/compat_signal.c
+7
-26
No files found.
arch/s390/kernel/compat_signal.c
View file @
c60a03fe
...
...
@@ -49,19 +49,6 @@ typedef struct
struct
ucontext32
uc
;
}
rt_sigframe32
;
static
inline
void
sigset_to_sigset32
(
unsigned
long
*
set64
,
compat_sigset_word
*
set32
)
{
set32
[
0
]
=
(
compat_sigset_word
)
set64
[
0
];
set32
[
1
]
=
(
compat_sigset_word
)(
set64
[
0
]
>>
32
);
}
static
inline
void
sigset32_to_sigset
(
compat_sigset_word
*
set32
,
unsigned
long
*
set64
)
{
set64
[
0
]
=
(
unsigned
long
)
set32
[
0
]
|
((
unsigned
long
)
set32
[
1
]
<<
32
);
}
int
copy_siginfo_to_user32
(
compat_siginfo_t
__user
*
to
,
const
siginfo_t
*
from
)
{
int
err
;
...
...
@@ -293,12 +280,10 @@ COMPAT_SYSCALL_DEFINE0(sigreturn)
{
struct
pt_regs
*
regs
=
task_pt_regs
(
current
);
sigframe32
__user
*
frame
=
(
sigframe32
__user
*
)
regs
->
gprs
[
15
];
compat_sigset_t
cset
;
sigset_t
set
;
if
(
__copy_from_user
(
&
cset
.
sig
,
&
frame
->
sc
.
oldmask
,
_SIGMASK_COPY_SIZE32
))
if
(
get_compat_sigset
(
&
set
,
(
compat_sigset_t
__user
*
)
frame
->
sc
.
oldmask
))
goto
badframe
;
sigset32_to_sigset
(
cset
.
sig
,
set
.
sig
);
set_current_blocked
(
&
set
);
save_fpu_regs
();
if
(
restore_sigregs32
(
regs
,
&
frame
->
sregs
))
...
...
@@ -316,12 +301,10 @@ COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
{
struct
pt_regs
*
regs
=
task_pt_regs
(
current
);
rt_sigframe32
__user
*
frame
=
(
rt_sigframe32
__user
*
)
regs
->
gprs
[
15
];
compat_sigset_t
cset
;
sigset_t
set
;
if
(
__copy_from_user
(
&
cset
,
&
frame
->
uc
.
uc_sigmask
,
sizeof
(
cset
)
))
if
(
get_compat_sigset
(
&
set
,
&
frame
->
uc
.
uc_sigmask
))
goto
badframe
;
sigset32_to_sigset
(
cset
.
sig
,
set
.
sig
);
set_current_blocked
(
&
set
);
if
(
compat_restore_altstack
(
&
frame
->
uc
.
uc_stack
))
goto
badframe
;
...
...
@@ -371,7 +354,6 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
{
int
sig
=
ksig
->
sig
;
sigframe32
__user
*
frame
;
struct
sigcontext32
sc
;
unsigned
long
restorer
;
size_t
frame_size
;
...
...
@@ -393,9 +375,10 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
return
-
EFAULT
;
/* Create struct sigcontext32 on the signal stack */
sigset_to_sigset32
(
set
->
sig
,
sc
.
oldmask
);
sc
.
sregs
=
(
__u32
)(
unsigned
long
__force
)
&
frame
->
sregs
;
if
(
__copy_to_user
(
&
frame
->
sc
,
&
sc
,
sizeof
(
frame
->
sc
)))
if
(
put_compat_sigset
((
compat_sigset_t
__user
*
)
frame
->
sc
.
oldmask
,
set
,
sizeof
(
compat_sigset_t
)))
return
-
EFAULT
;
if
(
__put_user
(
ptr_to_compat
(
&
frame
->
sc
),
&
frame
->
sc
.
sregs
))
return
-
EFAULT
;
/* Store registers needed to create the signal frame */
...
...
@@ -454,7 +437,6 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
static
int
setup_rt_frame32
(
struct
ksignal
*
ksig
,
sigset_t
*
set
,
struct
pt_regs
*
regs
)
{
compat_sigset_t
cset
;
rt_sigframe32
__user
*
frame
;
unsigned
long
restorer
;
size_t
frame_size
;
...
...
@@ -501,12 +483,11 @@ static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
store_sigregs
();
/* Create ucontext on the signal stack. */
sigset_to_sigset32
(
set
->
sig
,
cset
.
sig
);
if
(
__put_user
(
uc_flags
,
&
frame
->
uc
.
uc_flags
)
||
__put_user
(
0
,
&
frame
->
uc
.
uc_link
)
||
__compat_save_altstack
(
&
frame
->
uc
.
uc_stack
,
regs
->
gprs
[
15
])
||
save_sigregs32
(
regs
,
&
frame
->
uc
.
uc_mcontext
)
||
__copy_to_user
(
&
frame
->
uc
.
uc_sigmask
,
&
cset
,
sizeof
(
cse
t
))
||
put_compat_sigset
(
&
frame
->
uc
.
uc_sigmask
,
set
,
sizeof
(
compat_sigset_
t
))
||
save_sigregs_ext32
(
regs
,
&
frame
->
uc
.
uc_mcontext_ext
))
return
-
EFAULT
;
...
...
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