[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090414152020.C656.A69D9226@jp.fujitsu.com>
Date: Tue, 14 Apr 2009 15:21:51 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: kosaki.motohiro@...fujitsu.com, Linus Torvalds <torvalds@...l.org>,
Andrew Morton <akpm@...l.org>,
Nick Piggin <nickpiggin@...oo.com.au>,
Andrea Arcangeli <aarcange@...hat.com>,
Jeff Moyer <jmoyer@...hat.com>, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
Jens Axboe <jens.axboe@...cle.com>,
James Bottomley <James.Bottomley@...senPartnership.com>
Subject: [RFC][PATCH v3 5/6] don't use bio-map in read() path
Who know proper fixing way?
=================
Subject: [Untested][RFC][PATCH] don't use bio-map in read() path
__bio_map_user_iov() has wrong usage of get_user_pages_fast().
it doesn't have prevent fork mechanism.
then, it sould be used read-side (memory to device transfer) gup only.
This patch is obviously temporally fix. we can implement fork safe bio_map_user()
the future...
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: James Bottomley <James.Bottomley@...senPartnership.com>
---
block/blk-map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: b/block/blk-map.c
===================================================================
--- a/block/blk-map.c 2009-02-21 16:53:21.000000000 +0900
+++ b/block/blk-map.c 2009-04-12 23:36:32.000000000 +0900
@@ -55,7 +55,7 @@ static int __blk_rq_map_user(struct requ
* direct dma. else, set up kernel bounce buffers
*/
uaddr = (unsigned long) ubuf;
- if (blk_rq_aligned(q, ubuf, len) && !map_data)
+ if (blk_rq_aligned(q, ubuf, len) && !map_data && !reading)
bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
else
bio = bio_copy_user(q, map_data, uaddr, len, reading, gfp_mask);
@@ -208,7 +208,7 @@ int blk_rq_map_user_iov(struct request_q
}
}
- if (unaligned || (q->dma_pad_mask & len) || map_data)
+ if (unaligned || (q->dma_pad_mask & len) || map_data || read)
bio = bio_copy_user_iov(q, map_data, iov, iov_count, read,
gfp_mask);
else
--
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