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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Apr 2009 07:48:21 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	LKML <linux-kernel@...r.kernel.org>, linux-scsi@...r.kernel.org
Cc:	linux-fsdevel@...r.kernel.org, axboe@...nel.dk,
	Andrew Morton <akpm@...ux-foundation.org>,
	James.Bottomley@...senPartnership.com, bharrosh@...asas.com,
	osd-dev@...n-osd.org
Subject: [PATCH 1/3] block/blk-map.c: blk_rq_append_bio should ensure it's not appending a chain


Add a standard bit of list safety.  The other functions called in
blk_rq_append_bio() are written to assume only a single bio is passed to
them.  Therefore, it is an error to _ever_ pass a list to this function.

Enforce this error by ensuring the bio list is guaranteed to only append
a single list item with each blk_rq_append_bio() call.

Signed-off-by: Jeff Garzik <jgarzik@...hat.com>

diff --git a/block/blk-map.c b/block/blk-map.c
index f103729..a7eeac4 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -19,6 +19,7 @@ int blk_rq_append_bio(struct request_queue *q, struct request *rq,
 	else {
 		rq->biotail->bi_next = bio;
 		rq->biotail = bio;
+		bio->bi_next = NULL;
 
 		rq->data_len += bio->bi_size;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ