[patch] Fix BZ 19165 -- overflow in fread / fwrite

Zack Weinberg zackw@panix.com
Thu Feb 11 15:58:00 GMT 2016


On Thu, Feb 11, 2016 at 10:30 AM, Rich Felker <dalias@libc.org> wrote:
> On Thu, Feb 11, 2016 at 08:50:58AM -0500, Zack Weinberg wrote:
>>
>> [...] the kernel might need to finalize access checks and wire down the
>> pages for DMA before it even knows how much data is available.
>
> That makes no sense except for O_DIRECT wackiness where I doubt anyone
> cares about correctness/standards. Normal file reads should always be
> DMA into the fs cache followed by memcpy to the caller's buffer.

I was thinking of character devices and maybe also sockets.  Those don't
go through the fs cache.

And I don't think anyone wants the behavior to vary depending on which
kind of fd you have passed to read().

zw



More information about the Libc-alpha mailing list