diff options
| author | Srinivas Girigowda <sgirigow@codeaurora.org> | 2018-02-27 00:04:45 -0800 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-05-05 10:13:53 -0700 |
| commit | ee6e11636b39d99244bd65d8312a0adba9f7f250 (patch) | |
| tree | 6066a61986af8afa6b970906834f2d9e3e716d68 | |
| parent | b98fa1591744dce7c03581d4b79a47df6517ea2f (diff) | |
qcacmn: Match callback pointer type to callback function signature
Control Flow Integrity (CFI) implementation in the kernel.
CFI is an LLVM feature that protects function pointers against
control flow hijacking. Basically, when calling a function through
a pointer, the type of the pointer must match the signature
of the target function.
Hence, fix all the occurences of the function pointer type
which doesn't match the signature of the target function.
Change-Id: I910a7e1995dddf8fdcd7551f7a5e442e1d0120ab
CRs-Fixed: 2196475
| -rw-r--r-- | hif/src/ce/ce_main.c | 4 | ||||
| -rw-r--r-- | hif/src/pcie/if_pci.c | 2 | ||||
| -rw-r--r-- | htc/htc_internal.h | 4 | ||||
| -rw-r--r-- | htc/htc_send.c | 2 | ||||
| -rw-r--r-- | qdf/inc/osdep.h | 4 | ||||
| -rw-r--r-- | qdf/inc/qdf_types.h | 2 | ||||
| -rw-r--r-- | qdf/linux/src/i_qdf_timer.h | 19 | ||||
| -rw-r--r-- | wmi/src/wmi_unified.c | 8 |
8 files changed, 19 insertions, 26 deletions
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 751a7fd6bea8..6fbd121cd1ac 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -124,7 +124,7 @@ void hif_trigger_dump(struct hif_opaque_softc *hif_ctx, } } -static void ce_poll_timeout(void *arg) +static void ce_poll_timeout(unsigned long arg) { struct CE_state *CE_state = (struct CE_state *)arg; diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 1dcbc0260d5b..8ee5c510bbc9 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -1479,7 +1479,7 @@ static void soc_wake_reset(struct hif_softc *scn) * allow the target to go to sleep and cancel the sleep timer. * otherwise reschedule the sleep timer. */ -static void hif_sleep_entry(void *arg) +static void hif_sleep_entry(unsigned long arg) { struct HIF_CE_state *hif_state = (struct HIF_CE_state *)arg; struct hif_softc *scn = HIF_GET_SOFTC(hif_state); diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 8b747e8b73e2..35f8af1bc38d 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -306,7 +306,7 @@ void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint); void htc_fw_event_handler(void *context, QDF_STATUS status); -void htc_send_complete_check_cleanup(void *context); +void htc_send_complete_check_cleanup(unsigned long context); #ifdef FEATURE_RUNTIME_PM void htc_kick_queues(void *context); #endif diff --git a/htc/htc_send.c b/htc/htc_send.c index ce18266382ab..4b9dbd6e714d 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -201,7 +201,7 @@ static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket) } -void htc_send_complete_check_cleanup(void *context) +void htc_send_complete_check_cleanup(unsigned long context) { HTC_ENDPOINT *pEndpoint = (HTC_ENDPOINT *) context; diff --git a/qdf/inc/osdep.h b/qdf/inc/osdep.h index 1813513a7778..67ba026f54c4 100644 --- a/qdf/inc/osdep.h +++ b/qdf/inc/osdep.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -152,7 +152,7 @@ static inline unsigned char *os_malloc(osdev_t nic_dev, * different argument types for timer function in different OS. */ #define os_timer_func(_fn) \ - void _fn(void *timer_arg) + void _fn(unsigned long timer_arg) #define OS_GET_TIMER_ARG(_arg, _type) \ ((_arg) = (_type)(timer_arg)) diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index ff1185e6a573..cb6b2d337393 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -233,7 +233,7 @@ typedef void (*qdf_defer_fn_t)(void *); typedef bool (*qdf_irqlocked_func_t)(void *); /* Prototype of timer function */ -typedef void (*qdf_timer_func_t)(void *); +typedef void (*qdf_timer_func_t)(unsigned long); #define qdf_offsetof(type, field) offsetof(type, field) diff --git a/qdf/linux/src/i_qdf_timer.h b/qdf/linux/src/i_qdf_timer.h index caa5df4dc08d..ea0256bc9578 100644 --- a/qdf/linux/src/i_qdf_timer.h +++ b/qdf/linux/src/i_qdf_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -38,8 +38,6 @@ /* timer data type */ typedef struct timer_list __qdf_timer_t; -typedef void (*qdf_dummy_timer_func_t)(unsigned long arg); - /** * __qdf_timer_init() - initialize a softirq timer * @hdl: OS handle @@ -62,21 +60,16 @@ static inline QDF_STATUS __qdf_timer_init(qdf_handle_t hdl, { if (type == QDF_TIMER_TYPE_SW) { if (object_is_on_stack(timer)) - setup_deferrable_timer_on_stack( - timer, (qdf_dummy_timer_func_t)func, - (unsigned long)arg); + setup_deferrable_timer_on_stack(timer, func, + (unsigned long)arg); else - setup_deferrable_timer(timer, - (qdf_dummy_timer_func_t)func, + setup_deferrable_timer(timer, func, (unsigned long)arg); } else { if (object_is_on_stack(timer)) - setup_timer_on_stack(timer, - (qdf_dummy_timer_func_t)func, - (unsigned long)arg); + setup_timer_on_stack(timer, func, (unsigned long)arg); else - setup_timer(timer, (qdf_dummy_timer_func_t)func, - (unsigned long)arg); + setup_timer(timer, func, (unsigned long)arg); } return QDF_STATUS_SUCCESS; diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index a401f3384e04..b774a782f577 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1711,9 +1711,9 @@ static inline void wmi_workqueue_watchdog_warn(uint32_t msg_type_id) } #ifdef CONFIG_SLUB_DEBUG_ON -static void wmi_workqueue_watchdog_bite(void *arg) +static void wmi_workqueue_watchdog_bite(unsigned long arg) { - struct wmi_wq_dbg_info *info = arg; + struct wmi_wq_dbg_info *info = (struct wmi_wq_dbg_info *)arg; wmi_workqueue_watchdog_warn(info->wd_msg_type_id); qdf_print_thread_trace(info->task); @@ -1723,9 +1723,9 @@ static void wmi_workqueue_watchdog_bite(void *arg) QDF_BUG(0); } #else -static inline void wmi_workqueue_watchdog_bite(void *arg) +static inline void wmi_workqueue_watchdog_bite(unsigned long arg) { - struct wmi_wq_dbg_info *info = arg; + struct wmi_wq_dbg_info *info = (struct wmi_wq_dbg_info *)arg; wmi_workqueue_watchdog_warn(info->wd_msg_type_id); } |
