Page MenuHomeFreeBSD

D49674.id153183.diff
No OneTemporary

D49674.id153183.diff

diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -5075,6 +5075,18 @@
if (len == 0)
goto out;
+ /*
+ * Make sure that the ranges we check and lock below are valid.
+ */
+ if (inoff < 0 || outoff < 0) {
+ error = EINVAL;
+ goto out;
+ }
+ if (inoff + (off_t)len < 0)
+ len = INT64_MAX - inoff;
+ if (outoff + (off_t)len < 0)
+ len = INT64_MAX - outoff;
+
/*
* If infp and outfp refer to the same file, the byte ranges cannot
* overlap.

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 7, 9:00 AM (5 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36158456
Default Alt Text
D49674.id153183.diff (533 B)

Event Timeline