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
f8f8a727
Commit
f8f8a727
authored
Jun 27, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_compat_bpf_fprog(): don't copyin field-by-field
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5da028a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
net/compat.c
net/compat.c
+9
-9
No files found.
net/compat.c
View file @
f8f8a727
...
...
@@ -313,15 +313,15 @@ struct sock_fprog __user *get_compat_bpf_fprog(char __user *optval)
{
struct
compat_sock_fprog
__user
*
fprog32
=
(
struct
compat_sock_fprog
__user
*
)
optval
;
struct
sock_fprog
__user
*
kfprog
=
compat_alloc_user_space
(
sizeof
(
struct
sock_fprog
));
compat_uptr_t
ptr
;
u16
len
;
if
(
!
access_ok
(
VERIFY_READ
,
fprog32
,
sizeof
(
*
fprog32
))
||
!
access_ok
(
VERIFY_WRITE
,
kfprog
,
sizeof
(
struct
sock_fprog
))
||
__get_user
(
len
,
&
fprog32
->
len
)
||
__get_user
(
ptr
,
&
fprog32
->
filter
)
||
__put_user
(
len
,
&
kfprog
->
len
)
||
__put_user
(
compat_ptr
(
ptr
),
&
kfprog
->
filter
))
struct
compat_sock_fprog
f32
;
struct
sock_fprog
f
;
if
(
copy_from_user
(
&
f32
,
fprog32
,
sizeof
(
*
fprog32
)))
return
NULL
;
memset
(
&
f
,
0
,
sizeof
(
f
));
f
.
len
=
f32
.
len
;
f
.
filter
=
compat_ptr
(
f32
.
filter
);
if
(
copy_to_user
(
kfprog
,
&
f
,
sizeof
(
struct
sock_fprog
)
))
return
NULL
;
return
kfprog
;
...
...
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