twx-linux/include/uapi/rdma
Jason Gunthorpe 1250c3048c IB/uverbs: Handle IDR and FD types without truncation
Our ABI for write() uses a s32 for FDs and a u32 for IDRs, but internally
we ended up implicitly casting these ABI values into an 'int'. For ioctl()
we use a s64 for FDs and a u64 for IDRs, again casting to an int.

The various casts to int are all missing range checks which can cause
userspace values that should be considered invalid to be accepted.

Fix this by making the generic lookup routine accept a s64, which does not
truncate the write API's u32/s32 or the ioctl API's s64. Then push the
detailed range checking down to the actual type implementations to be
shared by both interfaces.

Finally, change the copy of the uobj->id to sign extend into a s64, so eg,
if we ever wish to return a negative value for a FD it is carried
properly.

This ensures that userspace values are never weirdly interpreted due to
the various trunctations and everything that is really out of range gets
an EINVAL.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-07-25 14:21:21 -06:00
..
hfi RDMA: Change all uapi headers to use __aligned_u64 instead of __u64 2018-03-27 14:25:09 -06:00
bnxt_re-abi.h RDMA: Change all uapi headers to use __aligned_u64 instead of __u64 2018-03-27 14:25:09 -06:00
cxgb3-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
cxgb4-abi.h rdma/cxgb4: Add support for 64Byte cqes 2018-07-13 11:52:55 -06:00
hns-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
i40iw-abi.h RDMA: Change all uapi headers to use __aligned_u64 instead of __u64 2018-03-27 14:25:09 -06:00
ib_user_cm.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
ib_user_ioctl_cmds.h RDMA/uverbs: Split UVERBS_ATTR_FLOW_ACTION_ESP_HANDLE 2018-07-04 13:47:01 -06:00
ib_user_ioctl_verbs.h IB/uverbs: Move ib_access_flags and ib_read_counters_flags to uapi 2018-07-23 15:45:34 -06:00
ib_user_mad.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
ib_user_sa.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
ib_user_verbs.h IB/uverbs: Pass IB_UVERBS_QPF_GRH_REQUIRED to user space 2018-07-10 11:13:04 -06:00
mlx4-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
mlx5_user_ioctl_cmds.h IB/mlx5: Introduce driver create and destroy flow methods 2018-07-24 14:03:49 -06:00
mlx5_user_ioctl_verbs.h IB/mlx5: Add implementation for create and destroy action_xfrm 2018-04-04 12:06:26 -06:00
mlx5-abi.h Merge branch 'mlx5-dump-fill-mkey' into rdma.git for-next 2018-07-04 13:23:46 -06:00
mthca-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
nes-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
ocrdma-abi.h RDMA: Change all uapi headers to use __aligned_u64 instead of __u64 2018-03-27 14:25:09 -06:00
qedr-abi.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
rdma_netlink.h RDMA/uapi: Fix uapi breakage 2018-05-15 15:54:46 -04:00
rdma_user_cm.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
rdma_user_ioctl_cmds.h IB/uverbs: Handle IDR and FD types without truncation 2018-07-25 14:21:21 -06:00
rdma_user_ioctl.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
rdma_user_rxe.h uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license 2018-04-23 11:10:33 -04:00
vmw_pvrdma-abi.h RDMA: Change all uapi headers to use __aligned_u64 instead of __u64 2018-03-27 14:25:09 -06:00