summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-04 06:14:54 +0000
committeralc <alc@FreeBSD.org>2003-04-04 06:14:54 +0000
commitcbd6318ffdb340e5a49bcbcb93e97b292a5924ff (patch)
tree5f59c51fc62c1621043f93a95b00155d45ab9256
parentb72dee7e432894a54443ddfc0ebdb74e44b73a21 (diff)
downloadFreeBSD-src-cbd6318ffdb340e5a49bcbcb93e97b292a5924ff.zip
FreeBSD-src-cbd6318ffdb340e5a49bcbcb93e97b292a5924ff.tar.gz
o Check the b_bufsize passed to vmapbuf() returning an error
if it is invalid. o Remove a debugging printf() from vmapbuf(). Suggested by: tegge
-rw-r--r--sys/kern/vfs_bio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 489512c..f5d803a 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3618,7 +3618,8 @@ vmapbuf(struct buf *bp)
if ((bp->b_flags & B_PHYS) == 0)
panic("vmapbuf");
-
+ if (bp->b_bufsize < 0)
+ return (-1);
for (addr = (caddr_t)trunc_page((vm_offset_t)bp->b_data), pidx = 0;
addr < bp->b_data + bp->b_bufsize;
addr += PAGE_SIZE, pidx++) {
@@ -3635,7 +3636,6 @@ retry:
(bp->b_iocmd == BIO_READ) ?
(VM_PROT_READ|VM_PROT_WRITE) : VM_PROT_READ);
if (i < 0) {
- printf("vmapbuf: warning, bad user address during I/O\n");
vm_page_lock_queues();
for (i = 0; i < pidx; ++i) {
vm_page_unhold(bp->b_pages[i]);
OpenPOWER on IntegriCloud