git: 131336da4072 - stable/13 - pseudofs: limit writes to 1M
Konstantin Belousov
kib at FreeBSD.org
Fri Apr 23 11:15:20 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=131336da407264e9876a69291a028b91e804df16
commit 131336da407264e9876a69291a028b91e804df16
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-04-13 19:48:44 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-04-23 11:14:09 +0000
pseudofs: limit writes to 1M
(cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f)
---
sys/fs/pseudofs/pseudofs_vnops.c | 3 +++
1 file changed, 3 insertions(+)
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.
More information about the dev-commits-src-branches
mailing list