tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Should kqueue descriptors work outsid of the creating process?



Recently we found out (PR kern/46463) that kqueue() file descriptors, which
originaly were designed to be "local process only" objects, could be passed
with SCM_RIGHTS messages to other processes. They probably can not be
transfered any other way (i.e. on fork() they are not inherited). So this
looks like an oversight, which would be easy to fix.

I propose to not allow sending kqueue file descriptors (blocking them and
bailing with EPERM in unp_internalize), document this behaviour, and add
test cases for it.

Or are there any legit uses for "foreign" kqueue()s?

I don't see any, the alien process could just create its own kqueue() and
add the same events instead of passing the filedescriptor over.

Martin


Home | Main Index | Thread Index | Old Index