Commit 99a5e178 authored by Kees Cook's avatar Kees Cook Committed by David S. Miller

ATM: 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: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47941950
...@@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry) ...@@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
} }
static struct lane2_ops lane2_ops = { static struct lane2_ops lane2_ops = {
lane2_resolve, /* resolve, spec 3.1.3 */ .resolve = lane2_resolve, /* spec 3.1.3 */
lane2_associate_req, /* associate_req, spec 3.1.4 */ .associate_req = lane2_associate_req, /* spec 3.1.4 */
NULL /* associate indicator, spec 3.1.5 */ .associate_indicator = NULL /* spec 3.1.5 */
}; };
static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
......
...@@ -535,33 +535,32 @@ static void eg_destroy_cache(struct mpoa_client *mpc) ...@@ -535,33 +535,32 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
static const struct in_cache_ops ingress_ops = { static const struct in_cache_ops ingress_ops = {
in_cache_add_entry, /* add_entry */ .add_entry = in_cache_add_entry,
in_cache_get, /* get */ .get = in_cache_get,
in_cache_get_with_mask, /* get_with_mask */ .get_with_mask = in_cache_get_with_mask,
in_cache_get_by_vcc, /* get_by_vcc */ .get_by_vcc = in_cache_get_by_vcc,
in_cache_put, /* put */ .put = in_cache_put,
in_cache_remove_entry, /* remove_entry */ .remove_entry = in_cache_remove_entry,
cache_hit, /* cache_hit */ .cache_hit = cache_hit,
clear_count_and_expired, /* clear_count */ .clear_count = clear_count_and_expired,
check_resolving_entries, /* check_resolving */ .check_resolving = check_resolving_entries,
refresh_entries, /* refresh */ .refresh = refresh_entries,
in_destroy_cache /* destroy_cache */ .destroy_cache = in_destroy_cache
}; };
static const struct eg_cache_ops egress_ops = { static const struct eg_cache_ops egress_ops = {
eg_cache_add_entry, /* add_entry */ .add_entry = eg_cache_add_entry,
eg_cache_get_by_cache_id, /* get_by_cache_id */ .get_by_cache_id = eg_cache_get_by_cache_id,
eg_cache_get_by_tag, /* get_by_tag */ .get_by_tag = eg_cache_get_by_tag,
eg_cache_get_by_vcc, /* get_by_vcc */ .get_by_vcc = eg_cache_get_by_vcc,
eg_cache_get_by_src_ip, /* get_by_src_ip */ .get_by_src_ip = eg_cache_get_by_src_ip,
eg_cache_put, /* put */ .put = eg_cache_put,
eg_cache_remove_entry, /* remove_entry */ .remove_entry = eg_cache_remove_entry,
update_eg_cache_entry, /* update */ .update = update_eg_cache_entry,
clear_expired, /* clear_expired */ .clear_expired = clear_expired,
eg_destroy_cache /* destroy_cache */ .destroy_cache = eg_destroy_cache
}; };
void atm_mpoa_init_cache(struct mpoa_client *mpc) void atm_mpoa_init_cache(struct mpoa_client *mpc)
{ {
mpc->in_ops = &ingress_ops; mpc->in_ops = &ingress_ops;
......
...@@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk) ...@@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
/* Socket control packet based operations. */ /* Socket control packet based operations. */
const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = { const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
vmci_transport_notify_pkt_socket_init, .socket_init = vmci_transport_notify_pkt_socket_init,
vmci_transport_notify_pkt_socket_destruct, .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
vmci_transport_notify_pkt_poll_in, .poll_in = vmci_transport_notify_pkt_poll_in,
vmci_transport_notify_pkt_poll_out, .poll_out = vmci_transport_notify_pkt_poll_out,
vmci_transport_notify_pkt_handle_pkt, .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
vmci_transport_notify_pkt_recv_init, .recv_init = vmci_transport_notify_pkt_recv_init,
vmci_transport_notify_pkt_recv_pre_block, .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
vmci_transport_notify_pkt_recv_pre_dequeue, .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
vmci_transport_notify_pkt_recv_post_dequeue, .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
vmci_transport_notify_pkt_send_init, .send_init = vmci_transport_notify_pkt_send_init,
vmci_transport_notify_pkt_send_pre_block, .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
vmci_transport_notify_pkt_send_pre_enqueue, .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
vmci_transport_notify_pkt_send_post_enqueue, .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
vmci_transport_notify_pkt_process_request, .process_request = vmci_transport_notify_pkt_process_request,
vmci_transport_notify_pkt_process_negotiate, .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
}; };
...@@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue( ...@@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
/* Socket always on control packet based operations. */ /* Socket always on control packet based operations. */
const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = { const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
vmci_transport_notify_pkt_socket_init, .socket_init = vmci_transport_notify_pkt_socket_init,
vmci_transport_notify_pkt_socket_destruct, .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
vmci_transport_notify_pkt_poll_in, .poll_in = vmci_transport_notify_pkt_poll_in,
vmci_transport_notify_pkt_poll_out, .poll_out = vmci_transport_notify_pkt_poll_out,
vmci_transport_notify_pkt_handle_pkt, .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
vmci_transport_notify_pkt_recv_init, .recv_init = vmci_transport_notify_pkt_recv_init,
vmci_transport_notify_pkt_recv_pre_block, .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
vmci_transport_notify_pkt_recv_pre_dequeue, .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
vmci_transport_notify_pkt_recv_post_dequeue, .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
vmci_transport_notify_pkt_send_init, .send_init = vmci_transport_notify_pkt_send_init,
vmci_transport_notify_pkt_send_pre_block, .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
vmci_transport_notify_pkt_send_pre_enqueue, .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
vmci_transport_notify_pkt_send_post_enqueue, .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
vmci_transport_notify_pkt_process_request, .process_request = vmci_transport_notify_pkt_process_request,
vmci_transport_notify_pkt_process_negotiate, .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment