|
|
Subscribe / Log in / New account

Use of ioctl()

Use of ioctl()

Posted Jun 16, 2022 9:04 UTC (Thu) by cortana (subscriber, #24596)
In reply to: Use of ioctl() by nybble41
Parent article: /dev/userfaultfd

That's what I thought but I count 41 capabilities in capabilities(7)... how can this be?


to post comments

Use of ioctl()

Posted Jun 16, 2022 11:59 UTC (Thu) by metan (subscriber, #74107) [Link] (1 responses)

Capabilities are actually stored as an array of structures. The structure is there since we have effective, permitted and inheritable sets of capabilities for each process. The array is there to get over the 32bit limitation and was implemented in v2 of the ABI. Currently we are at v3 and the array size is 2 so we are limited to 64 bits and we use 40 bits of that. So technically it's possible to add new capabilities, but I do understand that it's not desirable to add capability for random syscall like this since soon we would end up with thousands of capabilities and it would be a nightmare for any users of the interface.

Use of ioctl()

Posted Jun 16, 2022 14:59 UTC (Thu) by nybble41 (subscriber, #55106) [Link]

> Capabilities are actually stored as an array of structures.

Ah, I missed that the v2 ABI changed this to an array in 2007. I would imagine that it's still not that easy to extend it, since it appears to require a new version of the ABI to increase the array length, and any userspace tools and filesystems which work with capability sets would need to be updated as well. In a sense it's always going to be *possible* to extend the set of capabilities with ABI changes; the question is how much work is involved. Also, as long as the capability set remains a bitfield—and not, say, a sparse array—there will be significant overhead to tracking large numbers of potential capabilities, whether or not they're actually used by a given program.


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