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
7668b679
Commit
7668b679
authored
May 31, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put_compat_rusage(): switch to copy_to_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8f13621a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
kernel/compat.c
kernel/compat.c
+21
-19
No files found.
kernel/compat.c
View file @
7668b679
...
@@ -406,25 +406,27 @@ COMPAT_SYSCALL_DEFINE3(sigprocmask, int, how,
...
@@ -406,25 +406,27 @@ COMPAT_SYSCALL_DEFINE3(sigprocmask, int, how,
int
put_compat_rusage
(
const
struct
rusage
*
r
,
struct
compat_rusage
__user
*
ru
)
int
put_compat_rusage
(
const
struct
rusage
*
r
,
struct
compat_rusage
__user
*
ru
)
{
{
if
(
!
access_ok
(
VERIFY_WRITE
,
ru
,
sizeof
(
*
ru
))
||
struct
compat_rusage
r32
;
__put_user
(
r
->
ru_utime
.
tv_sec
,
&
ru
->
ru_utime
.
tv_sec
)
||
memset
(
&
r32
,
0
,
sizeof
(
r32
));
__put_user
(
r
->
ru_utime
.
tv_usec
,
&
ru
->
ru_utime
.
tv_usec
)
||
r32
.
ru_utime
.
tv_sec
=
r
->
ru_utime
.
tv_sec
;
__put_user
(
r
->
ru_stime
.
tv_sec
,
&
ru
->
ru_stime
.
tv_sec
)
||
r32
.
ru_utime
.
tv_usec
=
r
->
ru_utime
.
tv_usec
;
__put_user
(
r
->
ru_stime
.
tv_usec
,
&
ru
->
ru_stime
.
tv_usec
)
||
r32
.
ru_stime
.
tv_sec
=
r
->
ru_stime
.
tv_sec
;
__put_user
(
r
->
ru_maxrss
,
&
ru
->
ru_maxrss
)
||
r32
.
ru_stime
.
tv_usec
=
r
->
ru_stime
.
tv_usec
;
__put_user
(
r
->
ru_ixrss
,
&
ru
->
ru_ixrss
)
||
r32
.
ru_maxrss
=
r
->
ru_maxrss
;
__put_user
(
r
->
ru_idrss
,
&
ru
->
ru_idrss
)
||
r32
.
ru_ixrss
=
r
->
ru_ixrss
;
__put_user
(
r
->
ru_isrss
,
&
ru
->
ru_isrss
)
||
r32
.
ru_idrss
=
r
->
ru_idrss
;
__put_user
(
r
->
ru_minflt
,
&
ru
->
ru_minflt
)
||
r32
.
ru_isrss
=
r
->
ru_isrss
;
__put_user
(
r
->
ru_majflt
,
&
ru
->
ru_majflt
)
||
r32
.
ru_minflt
=
r
->
ru_minflt
;
__put_user
(
r
->
ru_nswap
,
&
ru
->
ru_nswap
)
||
r32
.
ru_majflt
=
r
->
ru_majflt
;
__put_user
(
r
->
ru_inblock
,
&
ru
->
ru_inblock
)
||
r32
.
ru_nswap
=
r
->
ru_nswap
;
__put_user
(
r
->
ru_oublock
,
&
ru
->
ru_oublock
)
||
r32
.
ru_inblock
=
r
->
ru_inblock
;
__put_user
(
r
->
ru_msgsnd
,
&
ru
->
ru_msgsnd
)
||
r32
.
ru_oublock
=
r
->
ru_oublock
;
__put_user
(
r
->
ru_msgrcv
,
&
ru
->
ru_msgrcv
)
||
r32
.
ru_msgsnd
=
r
->
ru_msgsnd
;
__put_user
(
r
->
ru_nsignals
,
&
ru
->
ru_nsignals
)
||
r32
.
ru_msgrcv
=
r
->
ru_msgrcv
;
__put_user
(
r
->
ru_nvcsw
,
&
ru
->
ru_nvcsw
)
||
r32
.
ru_nsignals
=
r
->
ru_nsignals
;
__put_user
(
r
->
ru_nivcsw
,
&
ru
->
ru_nivcsw
))
r32
.
ru_nvcsw
=
r
->
ru_nvcsw
;
r32
.
ru_nivcsw
=
r
->
ru_nivcsw
;
if
(
copy_to_user
(
ru
,
&
r32
,
sizeof
(
r32
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
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