This is the mail archive of the
mailing list for the glibc project.
Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite
- From: Zack Weinberg <zackw at panix dot com>
- To: Rich Felker <dalias at libc dot org>
- Cc: Florian Weimer <fweimer at redhat dot com>, Paul Eggert <eggert at cs dot ucla dot edu>, Alexander Cherepanov <ch3root at openwall dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Thu, 11 Feb 2016 10:58:00 -0500
- Subject: Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite
- Authentication-results: sourceware.org; auth=none
- References: <CALoOobOn9ni8FXK3W4ZGAEHSnYAEVUn10agEyC8NO62TyWg0ig at mail dot gmail dot com> <562FC0A8 dot 1080603 at openwall dot com> <CALoOobOxcxieyrfNf9Eg=wmymDyKUPZ_F+atPP+Af8dyYjez_w at mail dot gmail dot com> <5665D571 dot 3090504 at cs dot ucla dot edu> <CALoOobOm6waSvc+pS0DeNFDUq11MNL3xn0XeRNp2vVyOw7=pBA at mail dot gmail dot com> <5669D744 dot 5030307 at redhat dot com> <CALoOobNKxTg29=U_V00wTub5u_GdC3-LiEK-zEFgoW8r_s4RXw at mail dot gmail dot com> <20160211022624 dot GI9349 at brightrain dot aerifal dot cx> <56BC7CEF dot 5000305 at redhat dot com> <CAKCAbMjJ367xRSPwCo-jyTZNvH9P10dU1H7wZmuuKnAHDr+pGA at mail dot gmail dot com> <20160211153054 dot GM9349 at brightrain dot aerifal dot cx>
On Thu, Feb 11, 2016 at 10:30 AM, Rich Felker <firstname.lastname@example.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().