wsize = size + (offset - woffset);
wsize = PAGE_ALIGN(wsize);
+ /* Avoid SIGBUS on invalid accesses */
+ if (woffset + wsize > (uint64_t) PAGE_ALIGN(f->last_stat.st_size))
+ return -EADDRNOTAVAIL;
+
window = mmap(NULL, wsize, f->prot, MAP_SHARED, f->fd, woffset);
if (window == MAP_FAILED)
return -errno;
} else
delta = 0;
+ if (offset > (uint64_t) f->last_stat.st_size)
+ return -EADDRNOTAVAIL;
+
+ if (offset + size > (uint64_t) f->last_stat.st_size)
+ size = PAGE_ALIGN((uint64_t) f->last_stat.st_size - offset);
+
+ if (size <= 0)
+ return -EADDRNOTAVAIL;
+
r = journal_file_map(f,
offset, size,
&w->ptr, &w->offset, &w->size,
* - extend hash tables table as we go
* - accelerate looking for "all hostnames" and suchlike.
* - cryptographic hash
- * - never access beyond fle size check
* - OR of matches is borked...
+ * - flush /run to /var
+ * - hookup with systemctl
+ * - local deserializer
+ * - think about manipulations of header
+ * - http server
+ * - handle incomplete header
+ * - message catalog
*/
/* Write to daemon */