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
4b3256b3
Commit
4b3256b3
authored
Feb 06, 2003
by
James Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Fix skb leak in inet6_rtm_getroute.
parent
69dea591
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
net/ipv6/route.c
net/ipv6/route.c
+17
-9
No files found.
net/ipv6/route.c
View file @
4b3256b3
...
@@ -1548,14 +1548,14 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1548,14 +1548,14 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
{
{
struct
rtattr
**
rta
=
arg
;
struct
rtattr
**
rta
=
arg
;
int
iif
=
0
;
int
iif
=
0
;
int
err
;
int
err
=
-
ENOBUFS
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
struct
flowi
fl
;
struct
flowi
fl
;
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
;
skb
=
alloc_skb
(
NLMSG_GOODSIZE
,
GFP_KERNEL
);
skb
=
alloc_skb
(
NLMSG_GOODSIZE
,
GFP_KERNEL
);
if
(
skb
==
NULL
)
if
(
skb
==
NULL
)
return
-
ENOBUFS
;
goto
out
;
/* Reserve room for dummy headers, this skb can pass
/* Reserve room for dummy headers, this skb can pass
through good chunk of routing engine.
through good chunk of routing engine.
...
@@ -1579,8 +1579,10 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1579,8 +1579,10 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
if
(
iif
)
{
if
(
iif
)
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
dev
=
__dev_get_by_index
(
iif
);
dev
=
__dev_get_by_index
(
iif
);
if
(
!
dev
)
if
(
!
dev
)
{
return
-
ENODEV
;
err
=
-
ENODEV
;
goto
out_free
;
}
}
}
fl
.
oif
=
0
;
fl
.
oif
=
0
;
...
@@ -1597,13 +1599,19 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1597,13 +1599,19 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
fl
.
nl_u
.
ip6_u
.
saddr
,
fl
.
nl_u
.
ip6_u
.
saddr
,
iif
,
iif
,
RTM_NEWROUTE
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
);
RTM_NEWROUTE
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
);
if
(
err
<
0
)
if
(
err
<
0
)
{
return
-
EMSGSIZE
;
err
=
-
EMSGSIZE
;
goto
out_free
;
}
err
=
netlink_unicast
(
rtnl
,
skb
,
NETLINK_CB
(
in_skb
).
pid
,
MSG_DONTWAIT
);
err
=
netlink_unicast
(
rtnl
,
skb
,
NETLINK_CB
(
in_skb
).
pid
,
MSG_DONTWAIT
);
if
(
err
<
0
)
if
(
err
>
0
)
err
=
0
;
out:
return
err
;
return
err
;
return
0
;
out_free:
kfree_skb
(
skb
);
goto
out
;
}
}
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
)
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
)
...
...
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