|
From: Henrik N. <hn...@ma...> - 2003-04-28 07:36:34
|
On Sun, 27 Apr 2003, Matt Zimmerman wrote: > by MMAP_THRESHOLD) and if we can safely count on there being > at least one readable NUL byte after the end of the file's > contents. This is true for all tested operating systems when > the file size is not an exact multiple of the page size. Which is for good reasons.. not zeroing the remainder of the page is a security issue. memset(buffer, 0, PAGE_CACHE_SIZE) just before the call to read_file in hostfs_readpage should address this problem I think. Note: A quick inspection of the hostfs writepage function makes me think there is another bug in flushing the last page of modified mmaped files with an even page size. Regards Henrik |