New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 654091 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Non-SFI NaCl does not allow setting the FD_CLOEXEC flag on an fd

Project Member Reported by lhchavez@chromium.org, Oct 7 2016

Issue description

The sequence

const int flags = fcntl(fd, F_GETFD);
fcntl(fd, F_SETFD, flags | FD_CLOEXEC);

causes a SIGSYS in Non-SFI NaCl, although it seems like the intention is to allow it: https://cs.chromium.org/chromium/src/native_client/src/nonsfi/linux/linux_sys_private.c?q=linux_sys_private.c&sq=package:chromium&dr&l=453 . This caused https://codereview.chromium.org/2394413002/ to be reverted.
 
Cc: mseaborn@chromium.org rickyz@chromium.org
On IRC, rickyz pointed me at https://codereview.chromium.org/239703011/diff/60001/components/nacl/loader/nonsfi/nonsfi_sandbox.cc: the policy there supposedly should allow it. Maybe there are other flags being returned, so we can't set the union those flags with O|CLOEXEC?
Status: WontFix (was: Untriaged)
I misread the code originally. The issue lies in fcntl(fd, F_GETFD) -- that's the one that's not allowed. I'll simply assume that the flags are 0 in Non-SFI NaCl.
Also happy to just allow F_GETFD in nonsfi nacl as well, though in this case, both solutions are equivalent because FD_CLOEXEC is the only supported fd flag at the moment.

Sign in to add a comment