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


* 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.

Anyway, I think the definition of __OPEN_NEEDS_MODE is still
incorrect.  It should check for any unknown flags in addition to
O_CREAT and O_TMPFILE.  Otherwise, we'll run into the same problem
again.


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