RDMA/uverbs: Introduce UCAP (User CAPabilities) API
authorChiara Meiohas <cmeiohas@nvidia.com>
Thu, 6 Mar 2025 11:51:26 +0000 (13:51 +0200)
committerLeon Romanovsky <leon@kernel.org>
Sun, 9 Mar 2025 17:13:02 +0000 (13:13 -0400)
commit61e51682816d395307f78ae06d640089054c28ab
tree2dbd9cb33c75cb5d2fdcad5d568c7178b1d5354a
parent1d5c69514e742846ad3b8727b51b1fd46ea251fd
RDMA/uverbs: Introduce UCAP (User CAPabilities) API

Implement a new User CAPabilities (UCAP) API to provide fine-grained
control over specific firmware features.

This approach offers more granular capabilities than the existing Linux
capabilities, which may be too generic for certain FW features.

This mechanism represents each capability as a character device with
root read-write access. Root processes can grant users special
privileges by allowing access to these character devices (e.g., using
chown).

UCAP character devices are located in /dev/infiniband and the class path
is /sys/class/infiniband_ucaps.

Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Link: https://patch.msgid.link/5a1379187cd21178e8554afc81a3c941f21af22f.1741261611.git.leon@kernel.org
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/Makefile
drivers/infiniband/core/ucaps.c [new file with mode: 0644]
drivers/infiniband/core/uverbs_main.c
include/rdma/ib_ucaps.h [new file with mode: 0644]