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
This commit is contained in:
Konstantin Belousov 2021-04-13 22:48:44 +03:00
parent 116f26f947
commit 5edf7227ec

View File

@ -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.