android_kernel_samsung_univ.../net
Ilya Dryomov 0c6679b05b libceph: validate con->state at the top of try_write()
commit 9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7 upstream.

ceph_con_workfn() validates con->state before calling try_read() and
then try_write().  However, try_read() temporarily releases con->mutex,
notably in process_message() and ceph_con_in_msg_alloc(), opening the
window for ceph_con_close() to sneak in, close the connection and
release con->sock.  When try_write() is called on the assumption that
con->state is still valid (i.e. not STANDBY or CLOSED), a NULL sock
gets passed to the networking stack:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
  IP: selinux_socket_sendmsg+0x5/0x20

Make sure con->state is valid at the top of try_write() and add an
explicit BUG_ON for this, similar to try_read().

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/23706
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-02 07:53:42 -07:00
..
6lowpan
9p net/9p: Switch to wait_event_killable() 2017-11-30 08:37:25 +00:00
802
8021q vlan: also check phy_driver ts_info for vlan's real device 2018-04-13 19:50:25 +02:00
appletalk
atm
ax25
batman-adv batman-adv: handle race condition for claims between gateways 2018-03-22 09:23:21 +01:00
bluetooth Bluetooth: Send HCI Set Event Mask Page 2 command only when needed 2018-04-13 19:50:21 +02:00
bridge netfilter: bridge: ebt_among: add more missing match size checks 2018-04-08 11:51:59 +02:00
caif
can can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once 2018-01-31 12:06:08 +01:00
ceph libceph: validate con->state at the top of try_write() 2018-05-02 07:53:42 -07:00
core net: fix deadlock while clearing neighbor proxy table 2018-04-29 07:50:06 +02:00
dcb
dccp dccp: check sk for closed state in dccp_sendmsg() 2018-03-31 18:12:33 +02:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-02-25 11:03:38 +01:00
dns_resolver KEYS: DNS: limit the length of option strings 2018-04-29 07:50:04 +02:00
dsa
ethernet
hsr
ieee802154 net: ieee802154: fix net_device reference release too early 2018-04-13 19:50:10 +02:00
ipv4 tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets 2018-04-29 07:50:06 +02:00
ipv6 ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy 2018-04-29 07:50:06 +02:00
ipx
irda
iucv net/iucv: Free memory obtained by kzalloc 2018-03-31 18:12:33 +02:00
key af_key: Fix slab-out-of-bounds in pfkey_compile_policy. 2018-04-13 19:50:01 +02:00
l2tp l2tp: check sockaddr length in pppol2tp_connect() 2018-04-29 07:50:04 +02:00
l3mdev
lapb
llc llc: fix NULL pointer deref for SOCK_ZAPPED 2018-04-29 07:50:06 +02:00
mac80211 mac80211: bail out from prep_connection() if a reconfig is ongoing 2018-04-13 19:50:01 +02:00
mac802154
mpls mpls, nospec: Sanitize array index in mpls_label_ok() 2018-03-11 16:19:47 +01:00
netfilter netfilter: ctnetlink: fix incorrect nf_ct_put during hash resize 2018-04-13 19:50:10 +02:00
netlabel
netlink netlink: make sure nladdr has correct size in netlink_connect() 2018-04-13 19:50:24 +02:00
netrom
nfc NFC: fix device-allocation error return 2017-11-30 08:37:23 +00:00
openvswitch openvswitch: Delete conntrack entry clashing with an expectation. 2018-03-24 10:58:43 +01:00
packet net: af_packet: fix race in PACKET_{R|T}X_RING 2018-04-29 07:50:06 +02:00
phonet
rds rds; Reset rs->rs_bound_addr in rds_add_bound() failure path 2018-04-13 19:50:13 +02:00
rfkill
rose
rxrpc rxrpc: check return value of skb_to_sgvec always 2018-04-13 19:50:23 +02:00
sched net sched actions: fix dumping which requires several messages to user space 2018-04-13 19:50:27 +02:00
sctp sctp: do not check port in sctp_inet6_cmp_addr 2018-04-29 07:50:05 +02:00
sunrpc rpc_pipefs: fix double-dput() 2018-04-24 09:32:11 +02:00
switchdev
tipc tipc: add policy for TIPC_NLA_NET_ADDR 2018-04-29 07:50:06 +02:00
unix
vmw_vsock
wimax
wireless nl80211: Sanitize array index in parse_txq_params 2018-02-25 11:03:53 +01:00
x25 net: x25: fix one potential use-after-free issue 2018-04-13 19:50:07 +02:00
xfrm xfrm: fix state migration copy replay sequence numbers 2018-04-13 19:50:08 +02:00
compat.c
Kconfig Make DST_CACHE a silent config option 2018-02-25 11:03:37 +01:00
Makefile
socket.c bpf: introduce BPF_JIT_ALWAYS_ON config 2018-02-03 17:04:24 +01:00
sysctl_net.c