projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec13ad1
)
net: avoid NULL deref in inet_ctl_sock_destroy()
author
Eric Dumazet
<
[email protected]
>
Mon, 2 Nov 2015 15:50:07 +0000
(07:50 -0800)
committer
David S. Miller
<
[email protected]
>
Tue, 3 Nov 2015 03:46:09 +0000
(22:46 -0500)
Under low memory conditions, tcp_sk_init() and icmp_sk_init()
can both iterate on all possible cpus and call inet_ctl_sock_destroy(),
with eventual NULL pointer.
Signed-off-by: Eric Dumazet <
[email protected]
>
Reported-by: Dmitry Vyukov <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
include/net/inet_common.h
patch
|
blob
|
history
diff --git
a/include/net/inet_common.h
b/include/net/inet_common.h
index 279f83591971bd886e78e1b20e4a5c29051fc563..109e3ee9108c0e0219f6cb64a21dc68f1f519ff6 100644
(file)
--- a/
include/net/inet_common.h
+++ b/
include/net/inet_common.h
@@
-41,7
+41,8
@@
int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
static inline void inet_ctl_sock_destroy(struct sock *sk)
{
- sock_release(sk->sk_socket);
+ if (sk)
+ sock_release(sk->sk_socket);
}
#endif