提交 7f6856b7 编写于 作者: K Kees Cook 提交者: Doug Ledford

RDMA/i40iw: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
Signed-off-by: NKees Cook <keescook@chromium.org>
Acked-by: NShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 6554c9f7
...@@ -4851,46 +4851,46 @@ void i40iw_vsi_stats_free(struct i40iw_sc_vsi *vsi) ...@@ -4851,46 +4851,46 @@ void i40iw_vsi_stats_free(struct i40iw_sc_vsi *vsi)
} }
static struct i40iw_cqp_ops iw_cqp_ops = { static struct i40iw_cqp_ops iw_cqp_ops = {
i40iw_sc_cqp_init, .cqp_init = i40iw_sc_cqp_init,
i40iw_sc_cqp_create, .cqp_create = i40iw_sc_cqp_create,
i40iw_sc_cqp_post_sq, .cqp_post_sq = i40iw_sc_cqp_post_sq,
i40iw_sc_cqp_get_next_send_wqe, .cqp_get_next_send_wqe = i40iw_sc_cqp_get_next_send_wqe,
i40iw_sc_cqp_destroy, .cqp_destroy = i40iw_sc_cqp_destroy,
i40iw_sc_poll_for_cqp_op_done .poll_for_cqp_op_done = i40iw_sc_poll_for_cqp_op_done
}; };
static struct i40iw_ccq_ops iw_ccq_ops = { static struct i40iw_ccq_ops iw_ccq_ops = {
i40iw_sc_ccq_init, .ccq_init = i40iw_sc_ccq_init,
i40iw_sc_ccq_create, .ccq_create = i40iw_sc_ccq_create,
i40iw_sc_ccq_destroy, .ccq_destroy = i40iw_sc_ccq_destroy,
i40iw_sc_ccq_create_done, .ccq_create_done = i40iw_sc_ccq_create_done,
i40iw_sc_ccq_get_cqe_info, .ccq_get_cqe_info = i40iw_sc_ccq_get_cqe_info,
i40iw_sc_ccq_arm .ccq_arm = i40iw_sc_ccq_arm
}; };
static struct i40iw_ceq_ops iw_ceq_ops = { static struct i40iw_ceq_ops iw_ceq_ops = {
i40iw_sc_ceq_init, .ceq_init = i40iw_sc_ceq_init,
i40iw_sc_ceq_create, .ceq_create = i40iw_sc_ceq_create,
i40iw_sc_cceq_create_done, .cceq_create_done = i40iw_sc_cceq_create_done,
i40iw_sc_cceq_destroy_done, .cceq_destroy_done = i40iw_sc_cceq_destroy_done,
i40iw_sc_cceq_create, .cceq_create = i40iw_sc_cceq_create,
i40iw_sc_ceq_destroy, .ceq_destroy = i40iw_sc_ceq_destroy,
i40iw_sc_process_ceq .process_ceq = i40iw_sc_process_ceq
}; };
static struct i40iw_aeq_ops iw_aeq_ops = { static struct i40iw_aeq_ops iw_aeq_ops = {
i40iw_sc_aeq_init, .aeq_init = i40iw_sc_aeq_init,
i40iw_sc_aeq_create, .aeq_create = i40iw_sc_aeq_create,
i40iw_sc_aeq_destroy, .aeq_destroy = i40iw_sc_aeq_destroy,
i40iw_sc_get_next_aeqe, .get_next_aeqe = i40iw_sc_get_next_aeqe,
i40iw_sc_repost_aeq_entries, .repost_aeq_entries = i40iw_sc_repost_aeq_entries,
i40iw_sc_aeq_create_done, .aeq_create_done = i40iw_sc_aeq_create_done,
i40iw_sc_aeq_destroy_done .aeq_destroy_done = i40iw_sc_aeq_destroy_done
}; };
/* iwarp pd ops */ /* iwarp pd ops */
static struct i40iw_pd_ops iw_pd_ops = { static struct i40iw_pd_ops iw_pd_ops = {
i40iw_sc_pd_init, .pd_init = i40iw_sc_pd_init,
}; };
static struct i40iw_priv_qp_ops iw_priv_qp_ops = { static struct i40iw_priv_qp_ops iw_priv_qp_ops = {
...@@ -4909,53 +4909,51 @@ static struct i40iw_priv_qp_ops iw_priv_qp_ops = { ...@@ -4909,53 +4909,51 @@ static struct i40iw_priv_qp_ops iw_priv_qp_ops = {
}; };
static struct i40iw_priv_cq_ops iw_priv_cq_ops = { static struct i40iw_priv_cq_ops iw_priv_cq_ops = {
i40iw_sc_cq_init, .cq_init = i40iw_sc_cq_init,
i40iw_sc_cq_create, .cq_create = i40iw_sc_cq_create,
i40iw_sc_cq_destroy, .cq_destroy = i40iw_sc_cq_destroy,
i40iw_sc_cq_modify, .cq_modify = i40iw_sc_cq_modify,
}; };
static struct i40iw_mr_ops iw_mr_ops = { static struct i40iw_mr_ops iw_mr_ops = {
i40iw_sc_alloc_stag, .alloc_stag = i40iw_sc_alloc_stag,
i40iw_sc_mr_reg_non_shared, .mr_reg_non_shared = i40iw_sc_mr_reg_non_shared,
i40iw_sc_mr_reg_shared, .mr_reg_shared = i40iw_sc_mr_reg_shared,
i40iw_sc_dealloc_stag, .dealloc_stag = i40iw_sc_dealloc_stag,
i40iw_sc_query_stag, .query_stag = i40iw_sc_query_stag,
i40iw_sc_mw_alloc .mw_alloc = i40iw_sc_mw_alloc
}; };
static struct i40iw_cqp_misc_ops iw_cqp_misc_ops = { static struct i40iw_cqp_misc_ops iw_cqp_misc_ops = {
i40iw_sc_manage_push_page, .manage_push_page = i40iw_sc_manage_push_page,
i40iw_sc_manage_hmc_pm_func_table, .manage_hmc_pm_func_table = i40iw_sc_manage_hmc_pm_func_table,
i40iw_sc_set_hmc_resource_profile, .set_hmc_resource_profile = i40iw_sc_set_hmc_resource_profile,
i40iw_sc_commit_fpm_values, .commit_fpm_values = i40iw_sc_commit_fpm_values,
i40iw_sc_query_fpm_values, .query_fpm_values = i40iw_sc_query_fpm_values,
i40iw_sc_static_hmc_pages_allocated, .static_hmc_pages_allocated = i40iw_sc_static_hmc_pages_allocated,
i40iw_sc_add_arp_cache_entry, .add_arp_cache_entry = i40iw_sc_add_arp_cache_entry,
i40iw_sc_del_arp_cache_entry, .del_arp_cache_entry = i40iw_sc_del_arp_cache_entry,
i40iw_sc_query_arp_cache_entry, .query_arp_cache_entry = i40iw_sc_query_arp_cache_entry,
i40iw_sc_manage_apbvt_entry, .manage_apbvt_entry = i40iw_sc_manage_apbvt_entry,
i40iw_sc_manage_qhash_table_entry, .manage_qhash_table_entry = i40iw_sc_manage_qhash_table_entry,
i40iw_sc_alloc_local_mac_ipaddr_entry, .alloc_local_mac_ipaddr_table_entry = i40iw_sc_alloc_local_mac_ipaddr_entry,
i40iw_sc_add_local_mac_ipaddr_entry, .add_local_mac_ipaddr_entry = i40iw_sc_add_local_mac_ipaddr_entry,
i40iw_sc_del_local_mac_ipaddr_entry, .del_local_mac_ipaddr_entry = i40iw_sc_del_local_mac_ipaddr_entry,
i40iw_sc_cqp_nop, .cqp_nop = i40iw_sc_cqp_nop,
i40iw_sc_commit_fpm_values_done, .commit_fpm_values_done = i40iw_sc_commit_fpm_values_done,
i40iw_sc_query_fpm_values_done, .query_fpm_values_done = i40iw_sc_query_fpm_values_done,
i40iw_sc_manage_hmc_pm_func_table_done, .manage_hmc_pm_func_table_done = i40iw_sc_manage_hmc_pm_func_table_done,
i40iw_sc_suspend_qp, .update_suspend_qp = i40iw_sc_suspend_qp,
i40iw_sc_resume_qp .update_resume_qp = i40iw_sc_resume_qp
}; };
static struct i40iw_hmc_ops iw_hmc_ops = { static struct i40iw_hmc_ops iw_hmc_ops = {
i40iw_sc_init_iw_hmc, .init_iw_hmc = i40iw_sc_init_iw_hmc,
i40iw_sc_parse_fpm_query_buf, .parse_fpm_query_buf = i40iw_sc_parse_fpm_query_buf,
i40iw_sc_configure_iw_fpm, .configure_iw_fpm = i40iw_sc_configure_iw_fpm,
i40iw_sc_parse_fpm_commit_buf, .parse_fpm_commit_buf = i40iw_sc_parse_fpm_commit_buf,
i40iw_sc_create_hmc_obj, .create_hmc_object = i40iw_sc_create_hmc_obj,
i40iw_sc_del_hmc_obj, .del_hmc_object = i40iw_sc_del_hmc_obj
NULL,
NULL
}; };
/** /**
......
...@@ -913,29 +913,29 @@ enum i40iw_status_code i40iw_get_wqe_shift(u32 wqdepth, u32 sge, u32 inline_data ...@@ -913,29 +913,29 @@ enum i40iw_status_code i40iw_get_wqe_shift(u32 wqdepth, u32 sge, u32 inline_data
} }
static struct i40iw_qp_uk_ops iw_qp_uk_ops = { static struct i40iw_qp_uk_ops iw_qp_uk_ops = {
i40iw_qp_post_wr, .iw_qp_post_wr = i40iw_qp_post_wr,
i40iw_qp_ring_push_db, .iw_qp_ring_push_db = i40iw_qp_ring_push_db,
i40iw_rdma_write, .iw_rdma_write = i40iw_rdma_write,
i40iw_rdma_read, .iw_rdma_read = i40iw_rdma_read,
i40iw_send, .iw_send = i40iw_send,
i40iw_inline_rdma_write, .iw_inline_rdma_write = i40iw_inline_rdma_write,
i40iw_inline_send, .iw_inline_send = i40iw_inline_send,
i40iw_stag_local_invalidate, .iw_stag_local_invalidate = i40iw_stag_local_invalidate,
i40iw_mw_bind, .iw_mw_bind = i40iw_mw_bind,
i40iw_post_receive, .iw_post_receive = i40iw_post_receive,
i40iw_nop .iw_post_nop = i40iw_nop
}; };
static struct i40iw_cq_ops iw_cq_ops = { static struct i40iw_cq_ops iw_cq_ops = {
i40iw_cq_request_notification, .iw_cq_request_notification = i40iw_cq_request_notification,
i40iw_cq_poll_completion, .iw_cq_poll_completion = i40iw_cq_poll_completion,
i40iw_cq_post_entries, .iw_cq_post_entries = i40iw_cq_post_entries,
i40iw_clean_cq .iw_cq_clean = i40iw_clean_cq
}; };
static struct i40iw_device_uk_ops iw_device_uk_ops = { static struct i40iw_device_uk_ops iw_device_uk_ops = {
i40iw_cq_uk_init, .iwarp_cq_uk_init = i40iw_cq_uk_init,
i40iw_qp_uk_init, .iwarp_qp_uk_init = i40iw_qp_uk_init,
}; };
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册