linux-brain/include/linux/ceph
Ilya Dryomov 693860e795 libceph: fix alloc_msg_with_page_vector() memory leaks
commit e886274031200bb60965c1b9c49b7acda56a93bd upstream.

Make it so that CEPH_MSG_DATA_PAGES data item can own pages,
fixing a bunch of memory leaks for a page vector allocated in
alloc_msg_with_page_vector().  Currently, only watch-notify
messages trigger this allocation, and normally the page vector
is freed either in handle_watch_notify() or by the caller of
ceph_osdc_notify().  But if the message is freed before that
(e.g. if the session faults while reading in the message or
if the notify is stale), we leak the page vector.

This was supposed to be fixed by switching to a message-owned
pagelist, but that never happened.

Fixes: 1907920324 ("libceph: support for sending notifies")
Reported-by: Roman Penyaev <rpenyaev@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Roman Penyaev <rpenyaev@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-02 15:11:02 +02:00
..
auth.h libceph: add authorizer challenge 2018-08-02 21:33:24 +02:00
buffer.h libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer 2019-08-22 10:47:41 +02:00
ceph_debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ceph_features.h libceph: turn on CEPH_FEATURE_MSG_ADDR2 2019-07-08 14:01:43 +02:00
ceph_frag.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ceph_fs.h ceph: more precise CEPH_CLIENT_CAPS_PENDING_CAPSNAP 2019-07-08 14:01:44 +02:00
ceph_hash.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cls_lock_client.h rbd: support for object-map and fast-diff 2019-07-08 14:01:45 +02:00
debugfs.h ceph: no need to check return value of debugfs_create functions 2019-07-03 16:57:18 +02:00
decode.h libceph: rename ceph_encode_addr to ceph_encode_banner_addr 2019-07-08 14:01:43 +02:00
libceph.h libceph: add function that reset client's entity addr 2019-09-16 12:06:23 +02:00
mdsmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
messenger.h libceph: fix alloc_msg_with_page_vector() memory leaks 2020-04-02 15:11:02 +02:00
mon_client.h libceph: add function that reset client's entity addr 2019-09-16 12:06:23 +02:00
msgpool.h libceph: preallocate message data items 2018-10-22 10:28:22 +02:00
msgr.h libceph: add authorizer challenge 2018-08-02 21:33:24 +02:00
osd_client.h libceph: add function that clears osd client's abort_err 2019-09-16 12:06:23 +02:00
osdmap.h ceph: check POOL_FLAG_FULL/NEARFULL in addition to OSDMAP_FULL/NEARFULL 2020-04-01 11:01:58 +02:00
pagelist.h libceph: introduce ceph_pagelist_alloc() 2018-10-22 10:28:21 +02:00
rados.h ceph: check POOL_FLAG_FULL/NEARFULL in addition to OSDMAP_FULL/NEARFULL 2020-04-01 11:01:58 +02:00
string_table.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
striper.h rbd: support for object-map and fast-diff 2019-07-08 14:01:45 +02:00
types.h ceph: add mount option to limit caps count 2019-03-05 18:55:17 +01:00