|
|
Subscribe / Log in / New account

Grabbing file descriptors with pidfd_getfd()

Grabbing file descriptors with pidfd_getfd()

Posted Jan 10, 2020 20:53 UTC (Fri) by kylebot (guest, #134772)
Parent article: Grabbing file descriptors with pidfd_getfd()

If I remember correctly, one process can send file descriptors through sendmsg syscall?
Then what's the difference between these two methods.


to post comments

Grabbing file descriptors with pidfd_getfd()

Posted Jan 10, 2020 22:30 UTC (Fri) by cyphar (subscriber, #110703) [Link]

Using sendmsg(2) requires co-operation from the other side (or the injection of parasitic code a-la CRIU or rr). Those approaches are really suboptimal for a bunch of reasons, and having an interface which does this properly and doesn't require shellcode injection as part of normal code execution is a massive benefit. Not to mention that seccomp filters on the target process may block some of the syscalls needed for that to work.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds