Page MenuHomeFreeBSD

D43258.diff
No OneTemporary

D43258.diff

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -3361,8 +3361,7 @@
goto out;
if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0)
holein = 0;
- if (holein > 0)
- error = vn_getsize_locked(invp, &insize, incred);
+ error = vn_getsize_locked(invp, &insize, incred);
VOP_UNLOCK(invp);
if (error != 0)
goto out;
@@ -3398,7 +3397,11 @@
*/
if (error == 0)
error = vn_getsize_locked(outvp, &outsize, outcred);
- if (error == 0 && outsize > *outoffp && outsize <= *outoffp + len) {
+ if (error == 0 && outsize > *outoffp &&
+ *outoffp <= OFF_MAX - len && outsize <= *outoffp + len &&
+ *inoffp < insize &&
+ *outoffp <= OFF_MAX - (insize - *inoffp) &&
+ outsize <= *outoffp + (insize - *inoffp)) {
#ifdef MAC
error = mac_vnode_check_write(curthread->td_ucred,
outcred, outvp);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 1:55 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688312
Default Alt Text
D43258.diff (902 B)

Event Timeline