git: e71d5c733170 - main - Fix limit testing after 1762f674ccb571e6 ktrace commit.

Mateusz Guzik mjg at FreeBSD.org
Sat May 22 20:18:26 UTC 2021


The branch main has been updated by mjg:

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

commit e71d5c7331700504e58cf1a35dca529381723e02
Author:     Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-05-22 20:12:31 +0000
Commit:     Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-05-22 20:18:21 +0000

    Fix limit testing after 1762f674ccb571e6 ktrace commit.
    
    The previous:
    
    if ((uoff_t)uio->uio_offset + uio->uio_resid > lim)
            signal(....);
    
    was replaced with:
    
    if ((uoff_t)uio->uio_offset + uio->uio_resid < lim)
            return;
    signal(....);
    
    Making (uoff_t)uio->uio_offset + uio->uio_resid == lim trip over the
    limit, when it did not previously.
    
    Unbreaks running 13.0 buildworld.
---
 sys/kern/vfs_vnops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 9e45d1820eec..34fcef1b7e1f 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -2368,7 +2368,7 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio,
 		return (0);
 	ktr_write = (td->td_pflags & TDP_INKTRACE) != 0;
 	lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE);
-	if ((uoff_t)uio->uio_offset + uio->uio_resid < lim)
+	if ((uoff_t)uio->uio_offset + uio->uio_resid <= lim)
 		return (0);
 
 	if (!ktr_write || ktr_filesize_limit_signal) {


More information about the dev-commits-src-main mailing list