android_kernel_xiaomi_sm8350/net/ipv4
Pavel Emelyanov 28518fc170 [NET]: NULL pointer dereference and other nasty things in /proc/net/(tcp|udp)[6]
Commits f40c81 ([NETNS][IPV4] tcp - make proc handle the network
namespaces) and a91275 ([NETNS][IPV6] udp - make proc handle the
network namespace) both introduced bad checks on sockets and tw
buckets to belong to proper net namespace.

I.e. when checking for socket to belong to given net and family the

	do {
		sk = sk_next(sk);
	} while (sk && sk->sk_net != net && sk->sk_family != family);

constructions were used. This is wrong, since as soon as the
sk->sk_net fits the net the socket is immediately returned, even if it
belongs to other family.

As the result four /proc/net/(udp|tcp)[6] entries show wrong info.
The udp6 entry even oopses when dereferencing inet6_sk(sk) pointer:

static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket)
{
	...
        struct ipv6_pinfo *np = inet6_sk(sp);
	...

        dest  = &np->daddr; /* will be NULL for AF_INET sockets */
	...
	seq_printf(...
	           dest->s6_addr32[0], dest->s6_addr32[1],
                   dest->s6_addr32[2], dest->s6_addr32[3],
	...

Fix it by converting && to ||.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-21 15:52:00 -07:00
..
ipvs net: replace remaining __FUNCTION__ occurrences 2008-03-05 20:47:47 -08:00
netfilter Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-21 03:42:24 -07:00
af_inet.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-18 00:37:55 -07:00
ah4.c [IPSEC]: Fix bogus usage of u64 on input sequence number 2008-02-12 22:50:35 -08:00
arp.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
cipso_ipv4.c NetLabel: introduce a new kernel configuration API for NetLabel 2008-02-05 09:44:20 -08:00
datagram.c
devinet.c [NETNS]: Process inet_select_addr inside a namespace. 2008-02-28 20:52:54 -08:00
esp4.c [IPV4]: esp_output() misannotations 2008-03-17 22:50:23 -07:00
fib_frontend.c [NETNS]: Lookup in FIB semantic hashes taking into account the namespace. 2008-01-31 19:28:41 -08:00
fib_hash.c ipv4/fib_hash.c: fix NULL dereference 2008-02-19 16:28:54 -08:00
fib_lookup.h [IPV4] FIB_HASH: Reduce memory needs and speedup lookups 2008-01-28 15:02:46 -08:00
fib_rules.c [IPV4]: Consolidate fib_select_default. 2008-01-28 15:11:02 -08:00
fib_semantics.c [NETNS]: Lookup in FIB semantic hashes taking into account the namespace. 2008-01-31 19:28:41 -08:00
fib_trie.c fib_trie: /proc/net/route performance improvement 2008-02-12 17:53:31 -08:00
icmp.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
igmp.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
inet_connection_sock.c [INET]: Remove struct dst_entry *dst from request_sock_ops.rtx_syn_ack. 2008-02-29 11:43:03 -08:00
inet_diag.c [NETNS]: Tcp-v6 sockets per-net lookup. 2008-01-31 19:28:20 -08:00
inet_fragment.c [NETNS][FRAGS]: Make the pernet subsystem for fragments. 2008-01-28 15:10:40 -08:00
inet_hashtables.c [INET]: Unexport inet_listen_wlock 2008-02-13 17:40:25 -08:00
inet_lro.c
inet_timewait_sock.c [NETNS][IPV6] tcp - assign the netns for timewait sockets 2008-03-21 04:12:54 -07:00
inetpeer.c
ip_forward.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ip_fragment.c [NETNS][FRAGS]: Make the pernet subsystem for fragments. 2008-01-28 15:10:40 -08:00
ip_gre.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ip_input.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ip_options.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ip_output.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ip_sockglue.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-18 00:37:55 -07:00
ipcomp.c [IPCOMP]: Disable BH on output when using shared tfm 2008-02-28 11:23:17 -08:00
ipconfig.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-18 00:37:55 -07:00
ipip.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
ipmr.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
Kconfig [UDP]: Revert udplite and code split. 2008-03-06 16:22:02 -08:00
Makefile [UDP]: Revert udplite and code split. 2008-03-06 16:22:02 -08:00
netfilter.c [NETNS]: Add namespace parameter to ip_route_output_key. 2008-01-28 15:11:07 -08:00
proc.c [UDP]: Revert udplite and code split. 2008-03-06 16:22:02 -08:00
protocol.c
raw.c [NET]: Add debugging names to __RW_LOCK_UNLOCKED macros. 2008-03-18 00:59:23 -07:00
route.c [IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts 2008-03-05 18:30:47 -08:00
syncookies.c [TCP]: Add IPv6 support to TCP SYN cookies 2008-03-04 15:18:21 +09:00
sysctl_net_ipv4.c [TCP]: Fix a bug in strategy_allowed_congestion_control 2008-01-31 19:28:23 -08:00
tcp_bic.c [TCP]: BIC web page link is corrected. 2008-02-28 22:14:32 -08:00
tcp_cong.c [TCP]: Uninline tcp_is_cwnd_limited 2008-01-28 15:01:48 -08:00
tcp_cubic.c [TCP]: TCP cubic v2.2 2008-03-04 14:17:41 -08:00
tcp_diag.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c net: replace remaining __FUNCTION__ occurrences 2008-03-05 20:47:47 -08:00
tcp_ipv4.c [NET]: NULL pointer dereference and other nasty things in /proc/net/(tcp|udp)[6] 2008-03-21 15:52:00 -07:00
tcp_lp.c
tcp_minisocks.c [TCP]: Add IPv6 support to TCP SYN cookies 2008-03-04 15:18:21 +09:00
tcp_output.c [NET]: Add per-connection option to set max TSO frame size 2008-03-21 03:43:19 -07:00
tcp_probe.c
tcp_scalable.c
tcp_timer.c [TCP]: Do not purge sk_forward_alloc entirely in tcp_delack_timer(). 2008-01-28 15:01:42 -08:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c [SOCK] proto: Add hashinfo member to struct proto 2008-02-03 04:28:52 -08:00
tunnel4.c
udp_impl.h
udp.c [NET]: NULL pointer dereference and other nasty things in /proc/net/(tcp|udp)[6] 2008-03-21 15:52:00 -07:00
udplite.c [NETNS][IPV6] udp6 - make proc per namespace 2008-03-21 04:14:17 -07:00
xfrm4_input.c
xfrm4_mode_beet.c [IPSEC] xfrm4_beet_input(): fix an if() 2008-02-05 02:51:39 -08:00
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c [NET]: should explicitely initialize atomic_t field in struct dst_ops 2008-01-31 19:27:23 -08:00
xfrm4_state.c
xfrm4_tunnel.c [IPCOMP]: Fix reception of incompressible packets 2008-01-31 19:27:24 -08:00