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
8b7468f3
Commit
8b7468f3
authored
May 08, 2003
by
Andi Kleen
Committed by
David S. Miller
May 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Clean up socket filter compat handling.
parent
8fac33ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
net/compat.c
net/compat.c
+8
-14
No files found.
net/compat.c
View file @
8b7468f3
...
...
@@ -27,8 +27,6 @@
#include <asm/uaccess.h>
#include <net/compat.h>
#define AA(__x) ((unsigned long)(__x))
static
inline
int
iov_from_user_compat_to_kern
(
struct
iovec
*
kiov
,
struct
compat_iovec
*
uiov32
,
int
niov
)
...
...
@@ -393,31 +391,27 @@ static int do_set_attach_filter(int fd, int level, int optname,
struct
compat_sock_fprog
*
fprog32
=
(
struct
compat_sock_fprog
*
)
optval
;
struct
sock_fprog
kfprog
;
mm_segment_t
old_fs
;
compat_uptr_t
uptr
;
unsigned
int
fsize
;
int
ret
;
compat_uptr_t
ptr
;
if
(
!
access_ok
(
VERIFY_READ
,
fprog32
,
sizeof
(
*
fprog32
))
||
__get_user
(
kfprog
.
len
,
&
fprog32
->
len
)
||
__get_user
(
u
ptr
,
&
fprog32
->
filter
))
__get_user
(
ptr
,
&
fprog32
->
filter
))
return
-
EFAULT
;
kfprog
.
filter
=
compat_ptr
(
ptr
);
fsize
=
kfprog
.
len
*
sizeof
(
struct
sock_filter
);
kfprog
.
filter
=
(
struct
sock_filter
*
)
kmalloc
(
fsize
,
GFP_KERNEL
);
if
(
kfprog
.
filter
==
NULL
)
return
-
ENOMEM
;
if
(
copy_from_user
(
kfprog
.
filter
,
compat_ptr
(
uptr
),
fsize
))
{
kfree
(
kfprog
.
filter
);
if
(
kfprog
.
len
*
sizeof
(
struct
sock_filter
)
<
kfprog
.
len
)
return
-
EINVAL
;
if
(
verify_area
(
VERIFY_READ
,
kfprog
.
filter
,
kfprog
.
len
*
sizeof
(
struct
sock_filter
)))
return
-
EFAULT
;
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_setsockopt
(
fd
,
level
,
optname
,
(
char
*
)
&
kfprog
,
sizeof
(
kfprog
));
set_fs
(
old_fs
);
kfree
(
kfprog
.
filter
);
return
ret
;
}
...
...
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