Skip to content

Commit 8b0f93d

Browse files
Devesh Sharmarolandd
authored andcommitted
IB/core: Clear AH attr variable to prevent garbage data
During create-ah from userspace, uverbs is sending garbage data in attr.dmac and attr.vlan_id. This patch sets attr.dmac and attr.vlan_id to zero. Fixes: dd5f03b ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent fe82dce commit 8b0f93d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
25182518
attr.grh.sgid_index = cmd.attr.grh.sgid_index;
25192519
attr.grh.hop_limit = cmd.attr.grh.hop_limit;
25202520
attr.grh.traffic_class = cmd.attr.grh.traffic_class;
2521+
attr.vlan_id = 0;
2522+
memset(&attr.dmac, 0, sizeof(attr.dmac));
25212523
memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16);
25222524

25232525
ah = ib_create_ah(pd, &attr);

0 commit comments

Comments
 (0)