diff options
author | Devesh Sharma <devesh.sharma@emulex.com> | 2014-09-26 11:15:32 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-10-14 03:29:06 -0400 |
commit | 8b0f93d9490653a7b9fc91f3570089132faed1c0 (patch) | |
tree | 89b31b1a022bcd4eba352db9379b576e599ae2f6 | |
parent | fe82dcec644244676d55a1384c958d5f67979adb (diff) |
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: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures")
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 0600c50e6215..5ba2a86aab6a 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file, | |||
2518 | attr.grh.sgid_index = cmd.attr.grh.sgid_index; | 2518 | attr.grh.sgid_index = cmd.attr.grh.sgid_index; |
2519 | attr.grh.hop_limit = cmd.attr.grh.hop_limit; | 2519 | attr.grh.hop_limit = cmd.attr.grh.hop_limit; |
2520 | attr.grh.traffic_class = cmd.attr.grh.traffic_class; | 2520 | attr.grh.traffic_class = cmd.attr.grh.traffic_class; |
2521 | attr.vlan_id = 0; | ||
2522 | memset(&attr.dmac, 0, sizeof(attr.dmac)); | ||
2521 | memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16); | 2523 | memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16); |
2522 | 2524 | ||
2523 | ah = ib_create_ah(pd, &attr); | 2525 | ah = ib_create_ah(pd, &attr); |