This is the mail archive of the
mailing list for the glibc project.
Re: [patch] Fix BZ 19165 -- overflow in fread / fwrite
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: GLIBC Devel <libc-alpha at sourceware dot org>
- Cc: Alexander Cherepanov <ch3root at openwall dot com>
- Date: Thu, 11 Feb 2016 09:57:13 -0800
- 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> <CAKCAbMg-+S=P2z+ovkTRLAvdf5ggcMsnHgKxrHjtw3gYJe0cUQ at mail dot gmail dot com>
On 02/11/2016 07:58 AM, Zack Weinberg wrote:
I don't think anyone wants the behavior to vary depending on which
kind of fd you have passed to read().
As an application developer I'd rather have 'read', 'fread', etc. fail,
or even dump core, if I give them a buffer that is not entirely valid. I
hope, for example, that checkers like valgrind object to this sort of
thing, and would find it useful if glibc continues to report it as an
error. If POSIX really requires that 'read' and 'fread' must succeed in
this situation, then from my point of view it's a POSIX bug that needs
to get fixed, as the benefit of the extra checking is significant.