Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for flags in fcntl, socket, socketpair, accept4 #2003

Open
albe19029 opened this issue Aug 12, 2024 · 4 comments
Open

Add support for flags in fcntl, socket, socketpair, accept4 #2003

albe19029 opened this issue Aug 12, 2024 · 4 comments
Labels
kind/feature New feature or request
Milestone

Comments

@albe19029
Copy link
Contributor

For monitoring process files it is good to know CLOEXEC flag. But for now only part of method support it (inotify_init1, eventfd2, signalfd4, dup3, pipe2, open, openat, open_by_handle_at, pidfd_open,epoll_create1, memfd_create)

But I think this one are very important too:

fcntl (F_DUPFD_CLOEXEC -FD_CLOEXEC, F_SETFD - FD_CLOEXEC)
socket (SOCK_CLOEXEC)
socketpair (SOCK_CLOEXEC)
accept4 (SOCK_CLOEXEC)

Is it possible to add this, as when execve will be called, it is impossible to see which file descriptors should be copy to new process, and which should not.

I also noticed that for some methods flags exists, but in native format, not scap portable PPM_*_CLOEXEC (pidfd_getfd, timerfd_create, userfaultfd)

@albe19029 albe19029 added the kind/feature New feature or request label Aug 12, 2024
@Andreagit97
Copy link
Member

Hi @albe19029, yes you are right we need to improve the flags management in our syscalls. Your request makes sense! I will add it to the backlog

@Andreagit97 Andreagit97 added this to the TBD milestone Aug 12, 2024
@albe19029
Copy link
Contributor Author

Thanks a lot.
Forgot about one more moment:
is it also possible to add open_flags for not only SCAP_FD_FILE_V2 (for now scap_fd_flags_file this flags only added there).

@poiana
Copy link
Contributor

poiana commented Nov 10, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@albe19029
Copy link
Contributor Author

/remove-lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants