android_kernel_sony_msm8994/include/net
Eric Dumazet 263d0d7fb9
UPSTREAM: tcp: fix use after free in tcp_xmit_retransmit_queue()
(cherry picked from commit bb1fceca22492109be12640d49f5ea5a544c6bb4)

When tcp_sendmsg() allocates a fresh and empty skb, it puts it at the
tail of the write queue using tcp_add_write_queue_tail()

Then it attempts to copy user data into this fresh skb.

If the copy fails, we undo the work and remove the fresh skb.

Unfortunately, this undo lacks the change done to tp->highest_sack and
we can leave a dangling pointer (to a freed skb)

Later, tcp_xmit_retransmit_queue() can dereference this pointer and
access freed memory. For regular kernels where memory is not unmapped,
this might cause SACK bugs because tcp_highest_sack_seq() is buggy,
returning garbage instead of tp->snd_nxt, but with various debug
features like CONFIG_DEBUG_PAGEALLOC, this can crash the kernel.

This bug was found by Marco Grassi thanks to syzkaller.

Fixes: 6859d49475 ("[TCP]: Abstract tp->highest_sack accessing & point to next skb")
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I58bb02d6e4e399612e8580b9e02d11e661df82f5
Bug: 31183296
2017-01-11 22:59:05 +01:00
..
9p 9p: turn fid->dlist into hlist 2013-02-27 22:51:08 -05:00
bluetooth bluetooth: return on incorrect version or firmware download failure 2015-01-19 11:49:14 +05:30
caif caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
irda irda: small read past the end of array in debug code 2013-04-19 17:32:31 -04:00
iucv af_iucv: fix recvmsg by replacing skb_pull() function 2013-04-08 17:16:57 -04:00
netfilter netfilter: Changes to handle segmentation in SIP ALG 2015-01-27 15:47:39 -08:00
netns This is the 3.10.84 stable release 2015-08-13 14:38:09 -07:00
nfc NFC: RFKILL support 2013-04-12 16:54:45 +02:00
phonet
sctp net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks 2014-11-21 09:22:55 -08:00
tc_act
act_api.h act_police: move struct tcf_police to act_police.c 2013-02-12 18:59:45 -05:00
activity_stats.h net: activity_stats: Add statistics for network transmission activity 2013-07-01 13:40:29 -07:00
addrconf.h ipv6: clean up anycast when an interface is destroyed 2015-08-12 18:30:06 -07:00
af_ieee802154.h
af_rxrpc.h
af_unix.h 32.2.A.5.11 2016-12-05 22:37:37 +01:00
ah.h
arp.h
atmclip.h
ax25.h hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
ax88796.h
cfg80211-wext.h
cfg80211.h 32.2.A.0.224 2016-06-03 01:02:53 +02:00
checksum.h
cipso_ipv4.h net: fix cipso packet validation when !NETLABEL 2013-11-04 04:31:04 -08:00
cls_cgroup.h cls_cgroup: remove task_struct parameter from sock_update_classid() 2013-04-09 13:19:35 -04:00
cnss.h net: cnss: Add support for Runtime PM 2015-08-14 21:19:24 -07:00
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
dn_dev.h
dn_fib.h decnet: Parse netlink attributes on our own 2013-03-22 10:31:16 -04:00
dn_neigh.h
dn_nsp.h
dn_route.h decnet: use correct RCU API to deref sk_dst_cache field 2013-01-28 00:15:27 -05:00
dn.h
dsa.h
dsfield.h ipv6: Optimize ipv6_change_dsfield(). 2013-01-09 23:59:53 -08:00
dst_ops.h
dst.h net: dst: provide accessor function to dst->xfrm 2013-11-04 04:31:03 -08:00
esp.h
ethoc.h
fib_rules.h net: core: Support UID-based routing. 2014-11-04 13:06:30 -08:00
firewire.h firewire net, ipv4 arp: Extend hardware address and remove driver-level packet inspection. 2013-03-26 12:32:13 -04:00
flow_keys.h flow_keys: include thoff into flow_keys for later usage 2013-03-20 12:14:36 -04:00
flow.h ipv4, fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif 2015-08-12 18:30:13 -07:00
garp.h
gen_stats.h
genetlink.h genl: Hold reference on correct module while netlink-dump. 2013-09-14 06:54:55 -07:00
gre.h GRE: Refactor GRE tunneling code. 2013-03-26 12:27:18 -04:00
gro_cells.h gro: Fix kcalloc argument order 2013-01-27 22:46:33 -05:00
icmp.h ipv4: fix error handling in icmp_protocol. 2013-02-22 15:10:18 -05:00
ieee80211_radiotap.h mac80211: support (partial) VHT radiotap information 2012-11-27 11:56:18 +01:00
ieee802154_netdev.h ieee802154/nl-mac.c: make some MLME operations optional 2013-04-08 12:00:16 -04:00
ieee802154.h
if_inet6.h net: ipv6: only invalidate previously tokenized addresses 2013-04-09 13:12:23 -04:00
inet6_connection_sock.h
inet6_hashtables.h ipv6: use a stronger hash for tcp 2013-02-21 18:15:58 -05:00
inet_common.h
inet_connection_sock.h tcp: fix tcp_release_cb() to dispatch via address family for mtu_reduced() 2014-10-15 08:31:56 +02:00
inet_ecn.h
inet_frag.h net: frag, fix race conditions in LRU list maintenance 2013-05-06 11:06:51 -04:00
inet_hashtables.h hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
inet_sock.h net: support marking accepting TCP sockets 2014-06-23 15:21:22 -07:00
inet_timewait_sock.h hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
inetpeer.h inetpeer: get rid of ip_id_count 2014-08-14 09:24:15 +08:00
ip6_checksum.h ipv6: move csum_ipv6_magic() and udp6_csum_init() into static library 2013-01-08 17:56:10 -08:00
ip6_fib.h ipv6: prevent fib6_run_gc() contention 2015-07-03 19:48:09 -07:00
ip6_route.h ipv6: Limit mtu to 65575 bytes 2014-05-30 21:52:14 -07:00
ip6_tunnel.h GRE: Refactor GRE tunneling code. 2013-03-26 12:27:18 -04:00
ip_fib.h ipv4: fix definition of FIB_TABLE_HASHSZ 2013-03-13 10:47:09 -04:00
ip_tunnels.h ip_gre: Fix WCCPv2 header parsing. 2013-11-20 12:27:46 -08:00
ip_vs.h arch: Mass conversion of smp_mb__*() 2014-08-15 11:45:28 -07:00
ip.h net: Fail explicit bind to local reserved ports 2015-09-08 10:48:07 -07:00
ipcomp.h
ipconfig.h
ipv6.h 32.2.A.5.11 2016-12-05 22:37:37 +01:00
ipx.h
iw_handler.h
lapb.h
lib80211.h hostap: Don't use create_proc_read_entry() 2013-04-29 15:41:56 -04:00
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
llc.h
mac80211.h mac80211: add a flag to indicate CCK support for HT clients 2013-09-07 22:09:59 -07:00
mac802154.h
mip6.h
mld.h
mrp.h net/802: Implement Multiple Registration Protocol (MRP) 2013-02-10 20:37:22 -05:00
ndisc.h ndisc: Add missing inline to ndisc_addr_option_pad 2013-08-11 18:35:26 -07:00
neighbour.h net neighbour, decnet: Ensure to align device private data on preferred alignment. 2013-02-11 00:21:44 -05:00
net_namespace.h ipv4, fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif 2015-08-12 18:30:13 -07:00
net_ratelimit.h
netdma.h
netevent.h ipv6 netevent: Remove old_neigh from netevent_redirect. 2013-01-14 15:04:59 -05:00
netlabel.h
netlink.h
netprio_cgroup.h netprio_cgroup: remove task_struct parameter from sock_update_netprio() 2013-04-09 13:19:37 -04:00
netrom.h hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
nexthop.h
nl802154.h
p8022.h
ping.h net: ipv6: Add IPv6 support to the ping socket. 2014-05-06 09:18:35 -06:00
pkt_cls.h pkt_sched: namespace aware act_mirred 2013-01-14 15:09:36 -05:00
pkt_sched.h net: tc_qdisc_flow_control returning qdisc size 2014-05-29 11:20:36 -06:00
protocol.h net: Remove code duplication between offload structures 2012-11-15 17:39:51 -05:00
psnap.h
raw.h
rawv6.h
red.h
regulatory.h regulatory: use RCU to protect last_request 2013-01-03 13:01:30 +01:00
request_sock.h net: remove a stale comment for dl_next 2013-04-22 15:55:48 -04:00
rose.h
route.h Handle 'sk' being NULL in UID-based routing. 2014-11-04 13:08:33 -08:00
rtnetlink.h rtnetlink: Remove passing of attributes into rtnl_doit functions 2013-03-22 10:31:16 -04:00
sch_generic.h net_sched: restore "linklayer atm" handling 2013-09-14 06:54:55 -07:00
scm.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-04-22 20:32:51 -04:00
secure_seq.h inetpeer: get rid of ip_id_count 2014-08-14 09:24:15 +08:00
slhc_vj.h
snmp.h
sock.h net: diag: Add the ability to destroy a socket. 2017-01-11 22:57:32 +01:00
somc_wifi.h 32.1.A.1.185 2016-04-09 16:46:03 +02:00
stp.h
tcp_memcontrol.h
tcp_states.h
tcp.h UPSTREAM: tcp: fix use after free in tcp_xmit_retransmit_queue() 2017-01-11 22:59:05 +01:00
timewait_sock.h
transp_v6.h net: ipv6: Add IPv6 support to the ping socket. 2014-05-06 09:18:35 -06:00
udp.h ipv6: call udp_push_pending_frames when uncorking a socket with AF_INET pending data 2013-07-28 16:29:49 -07:00
udplite.h
wext.h
wimax.h
wpan-phy.h
x25.h
x25device.h
xfrm.h xfrm: force a garbage collection after deleting a policy 2013-05-31 17:30:07 -07:00