vn_bmap_seekhole: check that passed offset is non-negative

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37024
This commit is contained in:
Konstantin Belousov 2022-10-17 18:29:38 +03:00
parent 8b32cdec9c
commit 33ce178835

View File

@ -2576,7 +2576,7 @@ vn_bmap_seekhole_locked(struct vnode *vp, u_long cmd, off_t *off,
if (error != 0)
goto out;
noff = *off;
if (noff >= va.va_size) {
if (noff < 0 || noff >= va.va_size) {
error = ENXIO;
goto out;
}