From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Integer overflows in new AIO ubd driver
Date: Sun, 26 Mar 2006 20:49:25 +0200 [thread overview]
Message-ID: <1143398965.11224.146.camel@localhost.localdomain> (raw)
Hi,
I recently tried to benchmark the new AIO-based ubd driver (including
O_DIRECT), and ran into serious problems with filesystems > 4GB. I think
I found the problem; two overflows in ubd_kern.c (see patch).
My test system was 2.6.16 plus all patches from user-mode-linux.sf.net
minus no_cow_odirect. Symptoms were that ext3 complained that it was
tried to write blocks into the system zone, and switched the filesystem
to r/o.
I also experienced (hard) lockups when doing lots of I/O. But this seems
to be unrelated to this problem (but who knows).
Gerd
--- linux-2.6.16/arch/um/drivers/ubd_kern.c.orig 2006-03-26 16:57:11.000000000 +0200
+++ linux-2.6.16/arch/um/drivers/ubd_kern.c 2006-03-26 18:16:02.000000000 +0200
@@ -1228,7 +1228,7 @@ static void do_ubd_request(request_queue
while(dev->start_sg < dev->end_sg){
struct scatterlist *sg = &dev->sg[dev->start_sg];
- prepare_request(req, &io_req, req->sector << 9,
+ prepare_request(req, &io_req, (unsigned long long) req->sector << 9,
sg->offset, sg->length, sg->page);
if(do_io(&io_req, req, dev) == -EAGAIN)
@@ -1573,7 +1573,7 @@ static int do_io(struct io_thread_req *r
}
off = req->offsets[bit] + req->offset +
- start * req->sectorsize;
+ (unsigned long long) start * req->sectorsize;
len = (end - start) * req->sectorsize;
buf = &req->buffer[start * req->sectorsize];
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2006-03-26 18:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-26 18:49 Gerd Stolpmann [this message]
2006-03-27 15:38 ` [uml-devel] Integer overflows in new AIO ubd driver Jeff Dike
2006-03-27 15:47 ` Gerd Stolpmann
2006-03-29 19:33 ` Jeff Dike
2006-03-29 21:16 ` Gerd Stolpmann
2006-03-30 18:49 ` Jeff Dike
2006-05-08 17:26 ` Jeff Dike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1143398965.11224.146.camel@localhost.localdomain \
--to=info@gerd-stolpmann.de \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox