diff options
author | pjd <pjd@FreeBSD.org> | 2004-09-27 22:10:01 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-09-27 22:10:01 +0000 |
commit | 25b7bcde0d295b47c9e250166aa8be08addc4147 (patch) | |
tree | 26d052d31c7186c3f09d9146f3e49855b169c708 /sys | |
parent | 228c7133a0ec5a2cd5ac33b64db645badc3df2c4 (diff) | |
download | FreeBSD-src-25b7bcde0d295b47c9e250166aa8be08addc4147.zip FreeBSD-src-25b7bcde0d295b47c9e250166aa8be08addc4147.tar.gz |
Deny invalid I/O requests which comes from userland here, because later
we'll get a panic.
MT5 candidate.
Reviewed by: phk
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 261e1f2..5bb9d42 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -347,6 +347,12 @@ g_dev_strategy(struct bio *bp) KASSERT(cp->acr || cp->acw, ("Consumer with zero access count in g_dev_strategy")); + if ((bp->bio_offset % cp->provider->sectorsize) != 0 || + (bp->bio_bcount % cp->provider->sectorsize) != 0) { + biofinish(bp, NULL, EINVAL); + return; + } + for (;;) { /* * XXX: This is not an ideal solution, but I belive it to |