From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Sudarsana Kalluru <skalluru@marvell.com>,
GR-Linux-NIC-Dev@marvell.com, Rasesh Mody <rmody@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2 5/6] bna: Avoid clashing function prototypes
Date: Mon, 31 Oct 2022 16:04:57 -0500 [thread overview]
Message-ID: <Y2A4eQ67IihENQrb@work> (raw)
In-Reply-To: <202210290009.C42E731@keescook>
On Sat, Oct 29, 2022 at 12:12:26AM -0700, Kees Cook wrote:
> On Thu, Oct 27, 2022 at 03:20:47PM -0500, Gustavo A. R. Silva 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 227 warnings like these:
> >
> > drivers/net/ethernet/brocade/bna/bna_enet.c:519:3: warning: cast from 'void (*)(struct bna_ethport *, enum bna_ethport_event)' to 'bfa_fsm_t' (aka 'void (*)(void *, int)') converts to incompatible function type [-Wcast-function-type-strict]
> > bfa_fsm_set_state(ethport, bna_ethport_sm_down);
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > The bna state machine code heavily overloads its state machine functions,
> > so these have been separated into their own sets of structs, enums,
> > typedefs, and helper functions. There are almost zero binary code changes,
> > all seem to be related to header file line numbers changing, or the
> > addition of the new stats helper.
>
> This looks like it borrowed from
> https://lore.kernel.org/linux-hardening/20220929230334.2109344-1-keescook@chromium.org/
> Nice to get a couple hundred more fixed. :)
Yep; you're right. That's exactly the patch I was staring at
while doing these changes. :)
>
> > [1] https://reviews.llvm.org/D134831
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > ---
> > Changes in v2:
> > - None. This patch is new in the series.
>
> This is relatively stand-alone (not an iw_handler patch), so it could
> also go separately too.
My criteria here was that all these patches avoid clashing function
prototypes. So, they could be put together into a series, regardless
if they are "iw_handler" related patches.
> Reviewed-by: Kees Cook <keescook@chromium.org>
Thanks!
--
Gustavo
next prev parent reply other threads:[~2022-10-31 22:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 20:16 [PATCH v2 0/6] Avoid clashing function prototypes Gustavo A. R. Silva
2022-10-27 20:17 ` [PATCH v2 1/6] cfg80211: " Gustavo A. R. Silva
2022-10-28 8:22 ` Johannes Berg
2022-10-31 17:01 ` Gustavo A. R. Silva
2022-10-31 21:03 ` Gustavo A. R. Silva
2022-10-27 20:18 ` [PATCH v2 2/6] hostap: " Gustavo A. R. Silva
2022-10-29 7:26 ` Kees Cook
2022-11-01 9:36 ` Kalle Valo
2022-10-27 20:19 ` [PATCH v2 3/6] zd1201: " Gustavo A. R. Silva
2022-10-29 7:08 ` Kees Cook
2022-10-27 20:20 ` [PATCH v2 4/6] airo: " Gustavo A. R. Silva
2022-10-27 20:20 ` [PATCH v2 5/6] bna: " Gustavo A. R. Silva
2022-10-29 7:12 ` Kees Cook
2022-10-31 17:13 ` Gustavo A. R. Silva
2022-10-31 21:04 ` Gustavo A. R. Silva [this message]
2022-10-27 20:22 ` [PATCH v2 6/6] staging: ks7010: " Gustavo A. R. Silva
2022-10-29 7:20 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y2A4eQ67IihENQrb@work \
--to=gustavoars@kernel.org \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmody@marvell.com \
--cc=skalluru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.