diff options
| author | Ilya Dryomov <[email protected]> | 2018-04-24 17:10:55 +0000 |
|---|---|---|
| committer | Ilya Dryomov <[email protected]> | 2018-04-26 15:39:08 +0000 |
| commit | 9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7 (patch) | |
| tree | 1520b5b53003aa6bfee5e8afc255cd73061ffc2d /fs/proc/array.c | |
| parent | libceph: reschedule a tick in finish_hunting() (diff) | |
| download | kernel-9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7.tar.gz kernel-9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7.zip | |
libceph: validate con->state at the top of try_write()
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: [email protected]
Link: https://tracker.ceph.com/issues/23706
Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Jason Dillaman <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions
