lkml.org 
[lkml]   [2022]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 1/7] wifi: orinoco: Avoid clashing function prototypes
From
Date
"Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:

> 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 43 warnings like these:
>
> drivers/net/wireless/intersil/orinoco/wext.c:1379:27: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, struct iw_param *, 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(SIOCGIWPOWER, (iw_handler)orinoco_ioctl_getpower),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The orinoco 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. No significant binary differences were seen
> before/after changes.
>
> These changes were made partly manually and partly with the help of
> Coccinelle.
>
> Link: https://github.com/KSPP/linux/issues/234
> Link: https://reviews.llvm.org/D134831 [1]
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Reviewed-by: Kees Cook <keescook@chromium.org>

5 patches applied to wireless-next.git, thanks.

2c0e077db65a wifi: orinoco: Avoid clashing function prototypes
02ae6a7034d7 wifi: cfg80211: Avoid clashing function prototypes
fd7ef879a983 wifi: hostap: Avoid clashing function prototypes
ff7efc66b7ea wifi: zd1201: Avoid clashing function prototypes
89e706459848 wifi: airo: Avoid clashing function prototypes

--
https://patchwork.kernel.org/project/linux-wireless/patch/e564003608a1f2ad86283370ef816805c92b30f6.1667934775.git.gustavoars@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

\
 
 \ /
  Last update: 2022-11-16 10:33    [W:0.115 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site