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
5c4cee5b
Commit
5c4cee5b
authored
Feb 24, 2004
by
David Stevens
Committed by
Patrick McHardy
Feb 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IGMP/MLD]: Check for numsrc overflow, plus temp buffer tweaks.
parent
d894b915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
net/ipv4/ip_sockglue.c
net/ipv4/ip_sockglue.c
+8
-1
net/ipv6/ipv6_sockglue.c
net/ipv6/ipv6_sockglue.c
+7
-1
No files found.
net/ipv4/ip_sockglue.c
View file @
5c4cee5b
...
...
@@ -617,10 +617,15 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
}
case
IP_MSFILTER
:
{
extern
int
sysctl_optmem_max
;
struct
ip_msfilter
*
msf
;
if
(
optlen
<
IP_MSFILTER_SIZE
(
0
))
goto
e_inval
;
if
(
optlen
>
sysctl_optmem_max
)
{
err
=
-
ENOBUFS
;
break
;
}
msf
=
(
struct
ip_msfilter
*
)
kmalloc
(
optlen
,
GFP_KERNEL
);
if
(
msf
==
0
)
{
err
=
-
ENOBUFS
;
...
...
@@ -631,7 +636,9 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
kfree
(
msf
);
break
;
}
if
(
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
>
optlen
)
{
if
(
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
<
IP_MSFILTER_SIZE
(
0
)
||
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
>
optlen
)
{
kfree
(
msf
);
err
=
-
EINVAL
;
break
;
...
...
net/ipv6/ipv6_sockglue.c
View file @
5c4cee5b
...
...
@@ -436,10 +436,15 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval,
}
case
MCAST_MSFILTER
:
{
extern
int
sysctl_optmem_max
;
struct
group_filter
*
gsf
;
if
(
optlen
<
GROUP_FILTER_SIZE
(
0
))
goto
e_inval
;
if
(
optlen
>
sysctl_optmem_max
)
{
retv
=
-
ENOBUFS
;
break
;
}
gsf
=
(
struct
group_filter
*
)
kmalloc
(
optlen
,
GFP_KERNEL
);
if
(
gsf
==
0
)
{
retv
=
-
ENOBUFS
;
...
...
@@ -450,7 +455,8 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval,
kfree
(
gsf
);
break
;
}
if
(
GROUP_FILTER_SIZE
(
gsf
->
gf_numsrc
)
>
optlen
)
{
if
(
GROUP_FILTER_SIZE
(
gsf
->
gf_numsrc
)
<
GROUP_FILTER_SIZE
(
0
)
||
GROUP_FILTER_SIZE
(
gsf
->
gf_numsrc
)
>
optlen
)
{
kfree
(
gsf
);
retv
=
-
EINVAL
;
break
;
...
...
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