From a9c2bfa8e90156a5f5b87fafc643c9546b9a228b Mon Sep 17 00:00:00 2001 From: Jacques Vidrine Date: Tue, 10 Feb 2004 21:06:47 +0000 Subject: [PATCH] Fix a panic in pseudofs(9) that could occur when doing an I/O operation with a large request or large offset. Reported by: Joel Ray Holveck Submitted by: des --- sys/fs/pseudofs/pseudofs_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index 28b1a6551ad..d21145b416e 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -525,6 +525,11 @@ pfs_read(struct vop_read_args *va) PRELE(proc); PFS_RETURN (EINVAL); } + if (buflen > MAXPHYS) { + if (proc != NULL) + PRELE(proc); + PFS_RETURN (EIO); + } sb = sbuf_new(sb, NULL, buflen, 0); if (sb == NULL) { if (proc != NULL) -- 2.45.2