lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Dec 2017 12:33:45 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com
Cc:     Arnd Bergmann <arnd@...db.de>, Jens Axboe <axboe@...nel.dk>,
        Hannes Reinecke <hare@...e.com>,
        Bart Van Assche <bart.vanassche@....com>,
        NeilBrown <neilb@...e.com>,
        Mikulas Patocka <mpatocka@...hat.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Damien Le Moal <damien.lemoal@....com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] dm: fix uninitialized variable reference

The last bugfix apparently introduced another problem, as shown
by this gcc warning:

drivers/md/dm.c: In function '__send_changing_extent_only':
drivers/md/dm.c:1365:28: error: 'ti' is used uninitialized in this function [-Werror=uninitialized]

This restores the intialization of the 'ti' variable.

Fixes: aecefd4919de ("dm: fix __send_changing_extent_only() to send first bio and chain remainder")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
I did not test this or give the patch much thought, this just seemed
to be the most likely fix I could come up with in a short time, so
please review carefully, and ignore if the solution is something
else.
---
 drivers/md/dm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 05aa9c094352..f19e9787076e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1356,6 +1356,10 @@ static int __send_changing_extent_only(struct clone_info *ci,
 	unsigned len;
 	unsigned num_bios;
 
+	ti = dm_table_find_target(ci->map, ci->sector);
+	if (!dm_target_is_valid(ti))
+		return -EIO;
+
 	/*
 	 * Even though the device advertised support for this type of
 	 * request, that does not mean every target supports it, and
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ