truncate: invalid open64 call: O_CREAT or O_TMPFILE without mode

Ari Sundholm ari at tuxera.com
Wed Jan 13 14:05:32 UTC 2016


Hi,

On Wed, 2016-01-13 at 12:49 +0000, Christian Neukirchen wrote:
> Hi,
> 
> busybox v1.24.1 crashes here with glibc-2.22 upon this invocation:
> 
> % busybox truncate -s 1 /tmp/whatever
> *** invalid open64 call: O_CREAT or O_TMPFILE without mode ***: busybox terminated
> ======= Backtrace: =========
> /usr/lib/libc.so.6(+0x71e76)[0x7fa878384e76]
> /usr/lib/libc.so.6(__fortify_fail+0x37)[0x7fa87840cd17]
> /usr/lib/libc.so.6(+0xdc3bf)[0x7fa8783ef3bf]
> busybox(+0x6d49e)[0x55f69d7f749e]
> busybox(+0xaed3)[0x55f69d794ed3]
> busybox(+0xafde)[0x55f69d794fde]
> busybox(+0xb157)[0x55f69d795157]
> busybox(+0xab13)[0x55f69d794b13]
> /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fa878333680]
> busybox(+0xab79)[0x55f69d794b79]
> ...
> 
> And indeed, without -c this is bound to happen:
> 
>         if (!(opts & OPT_NOCREATE))
>                 flags |= O_CREAT;
> ...
>                 int fd = open(*argv, flags);
> 
> In conformance with GNU coreutils, this open(2) call should pass mode
> 0666 as a third argument.
> 

This is a known bug with a patch posted on this list on Mon, 04 Jan 2016
15:40:37 +0200.

Denys (or anyone with commit access), could you apply the patch and also
backport it to the 1.24.x branch?

Best regards,
Ari Sundholm
ari at tuxera.com



More information about the busybox mailing list