diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-10-08 18:25:19 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-10-08 18:25:19 +0000 |
| commit | 856de1908930aa5123901e58839e3df03d804dff (patch) | |
| tree | 78c007e05e3b306b026c643516d90f17f1a08d7e | |
| parent | d81ecf9abfef6f21f1ea8c6e94f2f51b259afbae (diff) | |
Notes
| -rw-r--r-- | sys/fs/specfs/spec_vnops.c | 7 | ||||
| -rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 0384da1ae44a..f6f33be4f6d9 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -120,6 +120,9 @@ VNODEOP_SET(spec_vnodeop_opv_desc); static int bdev_buffered = 1; SYSCTL_INT(_vfs, OID_AUTO, bdev_buffered, CTLFLAG_RW, &bdev_buffered, 0, ""); +static int enable_userblk_io = 1; +SYSCTL_INT(_vfs, OID_AUTO, enable_userblk_io, CTLFLAG_RW, &enable_userblk_io, 0, ""); + int spec_vnoperate(ap) struct vop_generic_args /* { @@ -331,6 +334,8 @@ spec_bufread(ap) int seqcount = ap->a_ioflag >> 16; dev_t dev; + if (!enable_userblk_io) + return (EINVAL); if (uio->uio_offset < 0) return (EINVAL); dev = vp->v_rdev; @@ -453,6 +458,8 @@ spec_bufwrite(ap) register int n, on; int error = 0; + if (!enable_userblk_io) + return (EINVAL); if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 0384da1ae44a..f6f33be4f6d9 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -120,6 +120,9 @@ VNODEOP_SET(spec_vnodeop_opv_desc); static int bdev_buffered = 1; SYSCTL_INT(_vfs, OID_AUTO, bdev_buffered, CTLFLAG_RW, &bdev_buffered, 0, ""); +static int enable_userblk_io = 1; +SYSCTL_INT(_vfs, OID_AUTO, enable_userblk_io, CTLFLAG_RW, &enable_userblk_io, 0, ""); + int spec_vnoperate(ap) struct vop_generic_args /* { @@ -331,6 +334,8 @@ spec_bufread(ap) int seqcount = ap->a_ioflag >> 16; dev_t dev; + if (!enable_userblk_io) + return (EINVAL); if (uio->uio_offset < 0) return (EINVAL); dev = vp->v_rdev; @@ -453,6 +458,8 @@ spec_bufwrite(ap) register int n, on; int error = 0; + if (!enable_userblk_io) + return (EINVAL); if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) |
