diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-04-13 19:48:44 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-04-14 07:23:21 +0000 |
commit | 5edf7227ec339f651c7328e63df323f6ef10345f (patch) | |
tree | b858cd60c15d723d6f0741fa10f9c8c39af68921 | |
parent | 116f26f947b8bbf868dcd85d79226406029a45ee (diff) | |
download | src-5edf7227ec339f651c7328e63df323f6ef10345f.tar.gz src-5edf7227ec339f651c7328e63df323f6ef10345f.zip |
pseudofs: limit writes to 1M
Noted and reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29752
-rw-r--r-- | sys/fs/pseudofs/pseudofs_vnops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index e386ceba71f8..29bb1544e7ad 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -1102,6 +1102,9 @@ pfs_write(struct vop_write_args *va) if (pn->pn_fill == NULL) PFS_RETURN (EIO); + if (uio->uio_resid > PFS_MAXBUFSIZ) + PFS_RETURN (EIO); + /* * This is necessary because either process' privileges may * have changed since the open() call. |