[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 1/2] fix O_CLOEXEC related build problems with kernel versions < 2.6.23
From:       Eugene Rudoy <gene.devel () gmail ! com>
Date:       2017-10-18 18:03:33
Message-ID: CAHQBez=0c3g_6nFdN16yg+4OUgiA9+Wmtb1Kg0DOxPDga5=05g () mail ! gmail ! com
[Download RAW message or body]

Hi Ralf,

On Wed, Oct 18, 2017 at 12:31 PM, Ralf Friedl <Ralf.Friedl@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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic