]> asedeno.scripts.mit.edu Git - linux.git/commit
RDMA/nldev: Prepare CAP_NET_ADMIN checks for .doit callbacks
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 30 Jan 2019 10:48:55 +0000 (12:48 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 31 Jan 2019 04:12:33 +0000 (21:12 -0700)
commit659067b0b5c36efa02ebae5e30d09d9303039029
treef9b4cc95ee64a81a80f714c2fd7b648faf2847bf
parent8be565e65fa9f4b1dee96e19bce3ca34e68cc8cb
RDMA/nldev: Prepare CAP_NET_ADMIN checks for .doit callbacks

The .doit callbacks don't have a netlink_callback to check capabilities so
in order to use the same fill_res_func for both .dump and .doit, we need
to do the capability check outside of those functions.

For .doit callbacks, it is possible to check CAP_NET_ADMIN directly on the
received sk_buff.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/nldev.c