This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v2] linux: open and openat ignore 'mode' with O_TMPFILE in flags
- From: Eric Rannaud <e at nanocritical dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Rich Felker <dalias at libc dot org>, Roland McGrath <roland at hack dot frob dot com>, libc-alpha <libc-alpha at sourceware dot org>, joseph <joseph at codesourcery dot com>
- Date: Fri, 12 Dec 2014 10:17:20 -0800
- Subject: Re: [PATCH v2] linux: open and openat ignore 'mode' with O_TMPFILE in flags
- Authentication-results: sourceware.org; auth=none
- References: <CAH_=xoZcXehKgY6jviDbmUpOxS7Vn_pWm75zzr+mT4dGop5sjQ at mail dot gmail dot com> <9e272d5ae70d7db36329c99785aefa9d32f0964d dot 1414714637 dot git dot e at nanocritical dot com> <CAH_=xoZbC1064T13ZXXdYp8c2mU15QANumefm1XzWCEG-XuDMg at mail dot gmail dot com> <87bnopwq3c dot fsf at mid dot deneb dot enyo dot de> <20141102164415 dot GQ22465 at brightrain dot aerifal dot cx> <548AC88A dot 3050106 at redhat dot com>
On Fri, Dec 12, 2014 at 2:50 AM, Florian Weimer <firstname.lastname@example.org> wrote:
>>>> This patch above is a straightforward fix, but Linus asks: why not
>>>> invoke va_arg() unconditionally? The 'mode' argument thus read could
>>>> not be used by the wrapper, as it could contain garbage, but it could
>>>> be passed untouched to the kernel.
>>> If technically undefined behavior which just happens to work is
>>> acceptable, you could also add the optional argument to the argument
>>> list. This would address the performance concern which may have been
>>> the reason to make the va_arg call conditional.
>> I don't think it's acceptable.
> I've asked on gcc-help:
I read this thread to mean that their answer is no, there is no GCC
portable way to play fast and loose with the optional argument, and
that we should stick with the current proposed patch?
My FSF papers are finally in. I will resubmit the latest version of
the patch shortly.