mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
RDMA/bnxt_re: Avoid exposing umdbr to userspace
The umdbr field in struct bnxt_re_db_region returns the raw
unmapped PCI BAR address of the doorbell region. Avoid sharing
this field to the userspace. Change this to a reserved field
and stop populating it, keeping the ABI layout and size
unchanged for existing binaries.
Fixes: 1234a9d8ae ("RDMA/bnxt_re: Support doorbell extensions")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Link: https://patch.msgid.link/20260824172443.33943-1-sriharsha.basavapatna@broadcom.com
Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
committed by
Leon Romanovsky
parent
99c24a8968
commit
23d7e03a52
@@ -462,7 +462,6 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_DBR_ALLOC)(struct uverbs_attr_bundle *a
|
||||
uobj->object = obj;
|
||||
uverbs_finalize_uobj_create(attrs, BNXT_RE_ALLOC_DBR_HANDLE);
|
||||
|
||||
dbr.umdbr = dpi->umdbr;
|
||||
dbr.dpi = dpi->dpi;
|
||||
ret = uverbs_copy_to_struct_or_zero(attrs, BNXT_RE_ALLOC_DBR_ATTR,
|
||||
&dbr, sizeof(dbr));
|
||||
@@ -525,7 +524,6 @@ static int UVERBS_HANDLER(BNXT_RE_METHOD_GET_DEFAULT_DBR)(struct uverbs_attr_bun
|
||||
return PTR_ERR(ib_uctx);
|
||||
|
||||
uctx = container_of(ib_uctx, struct bnxt_re_ucontext, ib_uctx);
|
||||
dpi.umdbr = uctx->dpi.umdbr;
|
||||
dpi.dpi = uctx->dpi.dpi;
|
||||
|
||||
ret = uverbs_copy_to_struct_or_zero(attrs, BNXT_RE_DEFAULT_DBR_ATTR,
|
||||
@@ -543,7 +541,7 @@ DECLARE_UVERBS_NAMED_METHOD(BNXT_RE_METHOD_DBR_ALLOC,
|
||||
UA_MANDATORY),
|
||||
UVERBS_ATTR_PTR_OUT(BNXT_RE_ALLOC_DBR_ATTR,
|
||||
UVERBS_ATTR_STRUCT(struct bnxt_re_db_region,
|
||||
umdbr),
|
||||
reserved2),
|
||||
UA_MANDATORY),
|
||||
UVERBS_ATTR_PTR_OUT(BNXT_RE_ALLOC_DBR_OFFSET,
|
||||
UVERBS_ATTR_TYPE(u64),
|
||||
@@ -563,7 +561,7 @@ DECLARE_UVERBS_NAMED_OBJECT(BNXT_RE_OBJECT_DBR,
|
||||
DECLARE_UVERBS_NAMED_METHOD(BNXT_RE_METHOD_GET_DEFAULT_DBR,
|
||||
UVERBS_ATTR_PTR_OUT(BNXT_RE_DEFAULT_DBR_ATTR,
|
||||
UVERBS_ATTR_STRUCT(struct bnxt_re_db_region,
|
||||
umdbr),
|
||||
reserved2),
|
||||
UA_MANDATORY));
|
||||
|
||||
DECLARE_UVERBS_GLOBAL_METHODS(BNXT_RE_OBJECT_DEFAULT_DBR,
|
||||
|
||||
@@ -250,7 +250,7 @@ struct bnxt_re_query_device_ex_resp {
|
||||
struct bnxt_re_db_region {
|
||||
__u32 dpi;
|
||||
__u32 reserved;
|
||||
__aligned_u64 umdbr;
|
||||
__aligned_u64 reserved2;
|
||||
};
|
||||
|
||||
enum bnxt_re_obj_dbr_alloc_attrs {
|
||||
|
||||
Reference in New Issue
Block a user