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>] [day] [month] [year] [list]
Message-id: <1545274454-1535-1-git-send-email-huijin.park@samsung.com>
Date:   Wed, 19 Dec 2018 21:54:14 -0500
From:   Huijin Park <huijin.park@...sung.com>
To:     Minchan Kim <minchan@...nel.org>, Nitin Gupta <ngupta@...are.org>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc:     Huijin Park <huijin.park@...sung.com>,
        Huijin Park <bbanghj.park@...il.com>,
        Jungseung Lee <js07.lee@...sung.com>,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org
Subject: [PATCH] zram: avoid calling bio_endio() before io complete

When the bio is given as parameter, zram calls the bio_endio() with
given bio after zram io finished.
However in the case of partial writing, the __zram_bvec_read() calls
the bio_endio() with the given bio regardless of the write operation.
In other words, the bio_endio() may be called at an unwanted time.
So this patch avoids calling bio_endio() with given bio before
writing is completed.

Signed-off-by: Huijin Park <huijin.park@...sung.com>
---
 drivers/block/zram/zram_drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 4879595..b3d3ba2 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1226,7 +1226,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec,
 		if (!page)
 			return -ENOMEM;
 
-		ret = __zram_bvec_read(zram, page, index, bio, true);
+		ret = __zram_bvec_read(zram, page, index, NULL, true);
 		if (ret)
 			goto out;
 
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ