Commit 44112bc
ipv6: fix potential "struct net" leak in inet6_rtm_getaddr()
[ Upstream commit 10bfd45 ]
It seems that if userspace provides a correct IFA_TARGET_NETNSID value
but no IFA_ADDRESS and IFA_LOCAL attributes, inet6_rtm_getaddr()
returns -EINVAL with an elevated "struct net" refcount.
Fixes: 6ecf4c3 ("ipv6: enable IFA_TARGET_NETNSID for RTM_GETADDR")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: David Ahern <dsahern@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 16edf51 commit 44112bc
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5505 | 5505 | | |
5506 | 5506 | | |
5507 | 5507 | | |
5508 | | - | |
5509 | | - | |
5510 | | - | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
5511 | 5512 | | |
5512 | 5513 | | |
5513 | 5514 | | |
| |||
0 commit comments