This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH 1/5] __fdelt_chk: Removed range check
- From: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>, "libc-ports at sourceware dot org" <libc-ports at sourceware dot org>
- Date: Wed, 01 May 2013 18:13:11 -0400
- Subject: Re: [PATCH 1/5] __fdelt_chk: Removed range check
- References: <1365900451-19026-1-git-send-email-kosaki dot motohiro at gmail dot com> <1365900451-19026-2-git-send-email-kosaki dot motohiro at gmail dot com> <51807D13 dot 9090706 at redhat dot com> <CAHGf_=oBg-XJ3RmqF_Ox7a3-UWpc0Gg+6LhVfm-sx0PLwjyLXQ at mail dot gmail dot com> <51812A69 dot 6000004 at redhat dot com>
>>> That means that we would have to recompile all of the
>>> applications again in order to get checking again using
>>> the new symbols proposed in PATCH #2?
>>
>> Right. Because, unfortunately, __fdelt_chk() doesn't have
>> buffer size argument, so we can't implement buffer overflow
>> checks on top of this interface.
>>
>> Then, I made new __fdelt_buffer_chk() function at patch #2.
>>
>> The rest problem is, how should we treat old interfaces? From
>> point of Ubuntu and OpenSUSE view, it should be disable, at least,
>> by default. Otherwise all applications need to recompile for disabling.
>>
>>
>>> This is not sufficiently conservative. We want it the other
>>> way around. A simple recompile of ruby should result in
>>> a ruby that no longer needs to disable _FORTIFY_SOURCE
>>> to work around FD_SETSIZE checks.
>>
>> If anyone have an alternative and better implementation idea, that's
>> welcome. I definitely agree this is ideal result.
>
> I don't think we want to disable the check.
>
> We added it for good reasons and it matches POSIX behaviour.
>
> At the end of the day we implement POSIX behaviour by default.
Could you clarify me my two questionsn?
1) If not disabling, Ubuntu/OpenSUSE need to recompile ALL of affected
packages. Do you suggest to recompile all of them?
Dear Ubuntu and OpenSUSE guys, please tell me your opinion. This patch
doesn't affect Fedora/RHEL/Debian. So I want to know which is close to
your desire.
2) I think my code correctly catch buffer overflow of posix codes too.
Do you disagree it? In the other words, what kind of application wants
to static checks?
> Ruby has already worked around this by disabling _FORTIFY_SOURCE
> in their code to avoid the assert.
Right. I don't mind ruby case.
> What we want to do is prevent them from needing to disable
> *ALL* of _FORTIFY_SOURCE and provide a macro that allows them
> to have finer grained control over the checks that apply to their
> code.
It can. but I want to understand which is better and why before to do.