Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Apr 2021 11:15:18 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 131336da4072 - stable/13 - pseudofs: limit writes to 1M
Message-ID:  <202104231115.13NBFIrK013447@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=131336da407264e9876a69291a028b91e804df16

commit 131336da407264e9876a69291a028b91e804df16
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-04-13 19:48:44 +0000
Commit:     Konstantin Belousov <kib@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104231115.13NBFIrK013447>