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]
Date:	Mon, 14 Jul 2014 14:49:20 +0000
From:	"Elliott, Robert (Server Storage)" <Elliott@...com>
To:	"axboe@...nel.dk" <axboe@...nel.dk>,
	"Elliott, Robert (Server Storage)" <Elliott@...com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] block: make blkdev_issue_flush check for NULL from bio_alloc

bio_alloc can return NULL if gfp_mask does not contain __GPF_WAIT
and it doesn't use a mempool.  Since blkdev_issue_flush passes
along gfp_mask, it needs to check if bio_alloc returns NULL.

Signed-off-by: Robert Elliott <elliott@...com>
---
 block/blk-flush.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/blk-flush.c b/block/blk-flush.c
index 3cb5e9e..2a9fd20 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -457,6 +457,8 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
 		return -ENXIO;
 
 	bio = bio_alloc(gfp_mask, 0);
+	if (!bio)
+		return -ENOMEM;
 	bio->bi_bdev = bdev;
 
 	ret = submit_bio_wait(WRITE_FLUSH, bio);

---
Rob Elliott    HP Server Storage



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ