remarkable-linux/net
Cong Wang 543a60112f llc: hold llc_sap before release_sock()
[ Upstream commit f7e4367268 ]

syzbot reported we still access llc->sap in llc_backlog_rcv()
after it is freed in llc_sap_remove_socket():

Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 llc_conn_ac_send_sabme_cmd_p_set_x+0x3a8/0x460 net/llc/llc_c_ac.c:785
 llc_exec_conn_trans_actions net/llc/llc_conn.c:475 [inline]
 llc_conn_service net/llc/llc_conn.c:400 [inline]
 llc_conn_state_process+0x4e1/0x13a0 net/llc/llc_conn.c:75
 llc_backlog_rcv+0x195/0x1e0 net/llc/llc_conn.c:891
 sk_backlog_rcv include/net/sock.h:909 [inline]
 __release_sock+0x12f/0x3a0 net/core/sock.c:2335
 release_sock+0xa4/0x2b0 net/core/sock.c:2850
 llc_ui_release+0xc8/0x220 net/llc/af_llc.c:204

llc->sap is refcount'ed and llc_sap_remove_socket() is paired
with llc_sap_add_socket(). This can be amended by holding its refcount
before llc_sap_remove_socket() and releasing it after release_sock().

Reported-by: <syzbot+6e181fc95081c2cf9051@syzkaller.appspotmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-29 11:33:13 +02:00
..
6lowpan
9p 9p/trans_virtio: discard zero-length reply 2018-02-22 15:42:30 +01:00
802
8021q vlan: also check phy_driver ts_info for vlan's real device 2018-04-12 12:32:24 +02:00
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Fix connection if directed advertising and privacy is used 2018-04-19 08:56:19 +02:00
bpf
bridge netfilter: compat: prepare xt_compat_init_offsets to return errors 2018-04-26 11:02:21 +02:00
caif
can
ceph
core vlan: Fix reading memory beyond skb->tail in skb_vlan_tagged_multi 2018-04-29 11:33:12 +02:00
dcb
dccp dccp: check sk for closed state in dccp_sendmsg() 2018-03-31 18:10:40 +02:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-02-25 11:07:52 +01:00
dns_resolver KEYS: DNS: limit the length of option strings 2018-04-29 11:33:10 +02:00
dsa net: dsa: Discard frames from unused ports 2018-04-24 09:36:39 +02:00
ethernet
hsr
ieee802154 ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event() 2018-03-31 18:10:40 +02:00
ife net: sched: ife: check on metadata length 2018-04-29 11:33:13 +02:00
ipv4 tcp: clear tp->packets_out when purging write queue 2018-04-29 11:33:13 +02:00
ipv6 ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts 2018-04-29 11:33:10 +02:00
ipx
iucv net/iucv: Free memory obtained by kzalloc 2018-03-31 18:10:41 +02:00
kcm kcm: lock lower socket in kcm_attach 2018-03-31 18:10:40 +02:00
key
l2tp l2tp: check sockaddr length in pppol2tp_connect() 2018-04-29 11:33:11 +02:00
l3mdev
lapb
llc llc: hold llc_sap before release_sock() 2018-04-29 11:33:13 +02:00
mac80211 mac80211: Fix setting TX power on monitor interfaces 2018-04-12 12:32:15 +02:00
mac802154
mpls mpls, nospec: Sanitize array index in mpls_label_ok() 2018-02-22 15:42:28 +01:00
ncsi
netfilter netfilter: x_tables: limit allocation requests for blob rule heads 2018-04-26 11:02:21 +02:00
netlabel
netlink netlink: make sure nladdr has correct size in netlink_connect() 2018-04-12 12:32:23 +02:00
netrom
nfc
nsh
openvswitch openvswitch: Remove padding from packet before L3+ conntrack processing 2018-04-26 11:02:15 +02:00
packet packet: fix bitfield update race 2018-04-29 11:33:12 +02:00
phonet
psample
qrtr
rds RDS: IB: Fix null pointer issue 2018-04-26 11:02:17 +02:00
rfkill
rose
rxrpc rxrpc: Don't put crypto buffers on the stack 2018-04-26 11:02:19 +02:00
sched net: sched: ife: handle malformed tlv length 2018-04-29 11:33:13 +02:00
sctp sctp: do not check port in sctp_inet6_cmp_addr 2018-04-29 11:33:12 +02:00
smc net/smc: fix shutdown in state SMC_LISTEN 2018-04-29 11:33:11 +02:00
strparser strparser: Fix incorrect strp->need_bytes value. 2018-04-29 11:33:13 +02:00
sunrpc SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context 2018-04-26 11:02:19 +02:00
switchdev
tipc tipc: add policy for TIPC_NLA_NET_ADDR 2018-04-29 11:33:12 +02:00
tls
unix
vmw_vsock VSOCK: fix outdated sk_state value in hvs_release() 2018-02-25 11:07:59 +01:00
wimax
wireless nl80211: Check for the required netlink attribute presence 2018-03-03 10:24:34 +01:00
x25
xfrm xfrm: Refuse to insert 32 bit userspace socket policies on 64 bit systems 2018-04-08 14:26:29 +02:00
compat.c
Kconfig
Makefile
socket.c kmemcheck: remove annotations 2018-02-22 15:42:23 +01:00
sysctl_net.c