lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <166495626187.5945.10399695218838618829.kvalo@kernel.org>
Date:   Wed,  5 Oct 2022 07:51:06 +0000 (UTC)
From:   Kalle Valo <kvalo@...nel.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Simon Kelley <simon@...kelleys.org.uk>,
        Kees Cook <keescook@...omium.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] wifi: atmel: Avoid clashing function prototypes

Kees Cook <keescook@...omium.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].
> 
> Of the 1549 warnings found, 188 come from the atmel driver. For example:
> 
> drivers/net/wireless/atmel/atmel.c:2518:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, void *, 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) atmel_config_commit,       /* SIOCSIWCOMMIT */
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> The atmel 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.
> 
> This patch is a cleanup based on Brad Spengler/PaX Team's modifications
> to the atmel driver in their last public patch of grsecurity/PaX based
> on my understanding of the code. Changes or omissions from the original
> code are mine and don't reflect the original grsecurity/PaX code.
> 
> [1] https://reviews.llvm.org/D134831
> 
> Cc: Simon Kelley <simon@...kelleys.org.uk>
> Cc: Kalle Valo <kvalo@...nel.org>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Jakub Kicinski <kuba@...nel.org>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: linux-wireless@...r.kernel.org
> Cc: netdev@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>

Patch applied to wireless-next.git, thanks.

8af9d4068e86 wifi: atmel: Avoid clashing function prototypes

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221002032428.4091540-1-keescook@chromium.org/

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ