Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 May 2021 00:39:14 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: d13215b99d0b - stable/12 - pseudofs: limit writes to 1M
Message-ID:  <202105010039.1410dEW6048322@gitrepo.freebsd.org>

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

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

commit d13215b99d0b9d04de111dd469938e6854fc3493
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-04-13 19:48:44 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-05-01 00:38:30 +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 6c025547b71b..510b6936d2fa 100644
--- a/sys/fs/pseudofs/pseudofs_vnops.c
+++ b/sys/fs/pseudofs/pseudofs_vnops.c
@@ -996,6 +996,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?202105010039.1410dEW6048322>