Hi Ralf,

On Wed, Oct 18, 2017 at 12:31 PM, Ralf Friedl <ralf.fri...@online.de> wrote:
> What is the purpose of O_CLOEXEC here? In both cases, we try to open a file.
> If the file is opened, we use the finit_module syscall and immediately close
> the file.  Is there a danger that finit_module might exec something and the
> file needs to be closed if that happens?
> Specifying O_CLOEXEC as a parameter to open just changes the value of the
> constant, although loading a large value like O_CLOEXEC needs an extra
> instruction on MIPS, but this adds an additional function call, so is it
> really needed?

Both changes within

# ifdef __NR_finit_module
...
#endif

are unnecessary. finit_module is available since kernel version 3.8,
so the code will only be executed for kernel versions definitely
supporting/providing O_CLOEXEC. I will omit the corresponding hunks
from v2 of my patch.

Denys can remove these two O_CLOEXEC's if he considers them being
unnecessary, but keeping them doesn't harm either.

Cheers,
Gene
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to