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
69655cb1
Commit
69655cb1
authored
Mar 30, 2003
by
Randolph Chung
Committed by
David S. Miller
Mar 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[COMPAT]: Fix sock_fprog handling.
parent
f5d6da7d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
net/compat.c
net/compat.c
+9
-8
No files found.
net/compat.c
View file @
69655cb1
...
@@ -496,6 +496,7 @@ static int do_set_attach_filter(int fd, int level, int optname,
...
@@ -496,6 +496,7 @@ static int do_set_attach_filter(int fd, int level, int optname,
struct
sock_fprog
kfprog
;
struct
sock_fprog
kfprog
;
mm_segment_t
old_fs
;
mm_segment_t
old_fs
;
compat_uptr_t
uptr
;
compat_uptr_t
uptr
;
unsigned
int
fsize
;
int
ret
;
int
ret
;
if
(
!
access_ok
(
VERIFY_READ
,
fprog32
,
sizeof
(
*
fprog32
))
||
if
(
!
access_ok
(
VERIFY_READ
,
fprog32
,
sizeof
(
*
fprog32
))
||
...
@@ -503,15 +504,14 @@ static int do_set_attach_filter(int fd, int level, int optname,
...
@@ -503,15 +504,14 @@ static int do_set_attach_filter(int fd, int level, int optname,
__get_user
(
uptr
,
&
fprog32
->
filter
))
__get_user
(
uptr
,
&
fprog32
->
filter
))
return
-
EFAULT
;
return
-
EFAULT
;
kfprog
.
filter
=
compat_ptr
(
uptr
);
fsize
=
kfprog
.
len
*
sizeof
(
struct
sock_filter
);
/*
kfprog
.
filter
=
(
struct
sock_filter
*
)
kmalloc
(
fsize
,
GFP_KERNEL
);
* Since struct sock_filter is architecure independent,
if
(
kfprog
.
filter
==
NULL
)
* we can just do the access_ok check and pass the
return
-
ENOMEM
;
* same pointer to the real syscall.
if
(
copy_from_user
(
kfprog
.
filter
,
compat_ptr
(
uptr
),
fsize
))
{
*/
kfree
(
kfprog
.
filter
);
if
(
!
access_ok
(
VERIFY_READ
,
kfprog
.
filter
,
kfprog
.
len
*
sizeof
(
struct
sock_filter
)))
return
-
EFAULT
;
return
-
EFAULT
;
}
old_fs
=
get_fs
();
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
...
@@ -519,6 +519,7 @@ static int do_set_attach_filter(int fd, int level, int optname,
...
@@ -519,6 +519,7 @@ static int do_set_attach_filter(int fd, int level, int optname,
(
char
*
)
&
kfprog
,
sizeof
(
kfprog
));
(
char
*
)
&
kfprog
,
sizeof
(
kfprog
));
set_fs
(
old_fs
);
set_fs
(
old_fs
);
kfree
(
kfprog
.
filter
);
return
ret
;
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