2020-11-11 12:57:34

by Sergei Shtepa

[permalink] [raw]
Subject: [PATCH 0/1] Bug with RCU locking in dm_blk_report_zones()

The dm_get_live_table() function makes RCU read lock and
dm_put_live_table() should call even when dm_table map was not found.

Sergei Shtepa (1):
Fix bug with RCU locking in dm_blk_report_zones().

drivers/md/dm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

--
2.20.1


2020-11-11 13:00:23

by Sergei Shtepa

[permalink] [raw]
Subject: [PATCH 1/1] Fix bug with RCU locking in dm_blk_report_zones().

The dm_get_live_table() function makes RCU read lock and
dm_put_live_table() should call even when dm_table map was not found.

Signed-off-by: Sergei Shtepa <[email protected]>
---
drivers/md/dm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c18fc2548518..98866e725f25 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -476,8 +476,10 @@ static int dm_blk_report_zones(struct gendisk *disk, sector_t sector,
return -EAGAIN;

map = dm_get_live_table(md, &srcu_idx);
- if (!map)
- return -EIO;
+ if (!map) {
+ ret = -EIO;
+ goto out;
+ }

do {
struct dm_target *tgt;
--
2.20.1