This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] linux: open and openat ignore 'mode' with O_TMPFILE in flags


On Thu, Oct 30, 2014 at 08:06:26PM -0700, Eric Rannaud 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.

This is valid only if you treat translation units as black boxes. If
they're not (think: LTO on glibc, which perhaps isn't supported now
but could be in the future) then all sorts of things could go wrong at
the compiler level that have nothing to do with whether this would
conceptually work at the ABI level. The most likely error seems to be
a compiler warning/error meant to catch this exact problem: calling
va_arg without a matching argument.

In principle the same could also happen at the hardware/ABI level on
some new arch; I'm kinda surprised if it doesn't already happen on
IA64.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]