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: Florian Weimer <fweimer at redhat dot com>
- To: Rich Felker <dalias at libc dot org>, Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Eric Rannaud <e at nanocritical dot com>, Roland McGrath <roland at hack dot frob dot com>, libc-alpha at sourceware dot org, joseph at codesourcery dot com
- Date: Fri, 12 Dec 2014 11:50:50 +0100
- 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>
On 11/02/2014 05:44 PM, Rich Felker wrote:
On Sun, Nov 02, 2014 at 04:59:35PM +0100, Florian Weimer wrote:
* Eric Rannaud:
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:
Florian Weimer / Red Hat Product Security