https://github.com/torvalds/linux
Revision 1f2c6651f69c14d0d3a9cfbda44ea101b02160ba authored by Ilya Dryomov on 11 October 2015, 17:38:00 UTC, committed by Ilya Dryomov on 23 October 2015, 16:36:03 UTC
Currently we leak parent_spec and trigger a "parent reference
underflow" warning if rbd_dev_create() in rbd_dev_probe_parent() fails.
The problem is we take the !parent out_err branch and that only drops
refcounts; parent_spec that would've been freed had we called
rbd_dev_unparent() remains and triggers rbd_warn() in
rbd_dev_parent_put() - at that point we have parent_spec != NULL and
parent_ref == 0, so counter ends up being -1 after the decrement.

Redo rbd_dev_probe_parent() to fix this.

Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 4.2
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
1 parent 7379047
History
Tip revision: 1f2c6651f69c14d0d3a9cfbda44ea101b02160ba authored by Ilya Dryomov on 11 October 2015, 17:38:00 UTC
rbd: don't leak parent_spec in rbd_dev_probe_parent()
Tip revision: 1f2c665
File Mode Size
Documentation
arch
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.get_maintainer.ignore -rw-r--r-- 31 bytes
.gitignore -rw-r--r-- 1.2 KB
.mailmap -rw-r--r-- 5.3 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 94.9 KB
Kbuild -rw-r--r-- 2.6 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 320.4 KB
Makefile -rw-r--r-- 53.2 KB
README -rw-r--r-- 18.2 KB
REPORTING-BUGS -rw-r--r-- 7.3 KB

README

back to top