diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-11-08 14:25:17 -0600 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-11-16 11:31:47 +0200 |
commit | fd7ef879a9835f9374fd611f2d6118e4a8f9b919 (patch) | |
tree | 4dcf79731ef2d52eefd57461deb9c67b7d8132eb /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 02ae6a7034d7b2e3d89e33d73da10a1f156789a0 (diff) |
wifi: hostap: Avoid clashing function prototypes
When built with Control Flow Integrity, function prototypes between
caller and function declaration must match. These mismatches are visible
at compile time with the new -Wcast-function-type-strict in Clang[1].
Fix a total of 42 warnings like these:
../drivers/net/wireless/intersil/hostap/hostap_ioctl.c:3868:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, char *, char *)' to 'iw_handler' (aka 'int (*)(struct net_device *, struct iw_request_info *, union iwreq_data *, char *)') converts to incompatible function type [-Wcast-function-type-strict]
(iw_handler) prism2_get_name, /* SIOCGIWNAME */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
The hostap Wireless Extension handler callbacks (iw_handler) use a
union for the data argument. Actually use the union and perform explicit
member selection in the function body instead of having a function
prototype mismatch. There are no resulting binary differences
before/after changes.
These changes were made partly manually and partly with the help of
Coccinelle.
Link: https://github.com/KSPP/linux/issues/235
Link: https://reviews.llvm.org/D134831 [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/e480e7713f1a4909ae011068c8d793cc4a638fbd.1667934775.git.gustavoars@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions