From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: Miri Korenblit <miriam.rachel.korenblit@intel.com>,
Johannes Berg <johannes.berg@intel.com>,
Yedidya Benshimol <yedidya.ben.shimol@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Avraham Stern <avraham.stern@intel.com>,
Daniel Gabay <daniel.gabay@intel.com>,
linux-wireless@vger.kernel.org,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] wifi: iwlwifi: mld: Work around Clang loop unrolling bug
Date: Fri, 25 Apr 2025 19:14:15 -0400 [thread overview]
Message-ID: <20250425231415.GA3584546@ax162> (raw)
In-Reply-To: <202504251032.51B2CB6233@keescook>
On Fri, Apr 25, 2025 at 11:18:33AM -0700, Kees Cook wrote:
> On Tue, Apr 22, 2025 at 12:59:03PM -0700, Nathan Chancellor wrote:
> > $ git cite
> > a33b5a08cbbd ("Merge tag 'sched_ext-for-6.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext")
>
> Make me look. :) "cite" is a local alias, yes? Looks like my own alias
> for "short", but basically "short HEAD". From my ~/.gitconfig:
>
> [alias]
> short = "!f() { for i in \"$@\"; do git log -1 --pretty='%h (\"%s\")' \"$i\"; done; }; f"
Heh, yes, that was me being lazy :) 'cite' ultimately expands to
show --format='%h ("%s")' --no-patch
to basically do what yours does.
$ git cite HEAD~2 HEAD^ HEAD
e72e9e693307 ("Merge tag 'net-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
30e268185e59 ("Merge tag 'landlock-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux")
02ddfb981de8 ("Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi")
> > diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
> > index fba6a7b1bb5c..7ce01ad3608e 100644
> > --- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c
> > +++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
> > @@ -1757,7 +1757,7 @@ iwl_mld_send_proto_offload(struct iwl_mld *mld,
> >
> > addrconf_addr_solict_mult(&wowlan_data->target_ipv6_addrs[i],
> > &solicited_addr);
> > - for (j = 0; j < c && j < n_nsc; j++)
> > + for (j = 0; j < n_nsc && j < c; j++)
> > if (ipv6_addr_cmp(&nsc[j].dest_ipv6_addr,
> > &solicited_addr) == 0)
> > break;
>
> Oof, an unstable solution. Well, I guess we work with what we've got.
> Your change also solves it for me, so I'll send a v2 with it that way.
Indeed... I will review v2 shortly but another option would be stick a
#include <linux/unroll.h>
#ifdef CONFIG_CC_IS_CLANG
unrolled_none
#endif
above the loop to just avoid tripping the optimizer up altogether but I
understand that is just as unstable as this one (even if it is one of
the few ways that the compiler gives us to turn off optimizations).
Cheers,
Nathan
prev parent reply other threads:[~2025-04-25 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 20:41 [PATCH] wifi: iwlwifi: mld: Work around Clang loop unrolling bug Kees Cook
2025-04-22 19:59 ` Nathan Chancellor
2025-04-25 18:18 ` Kees Cook
2025-04-25 23:14 ` Nathan Chancellor [this message]
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=20250425231415.GA3584546@ax162 \
--to=nathan@kernel.org \
--cc=avraham.stern@intel.com \
--cc=daniel.gabay@intel.com \
--cc=emmanuel.grumbach@intel.com \
--cc=johannes.berg@intel.com \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=miriam.rachel.korenblit@intel.com \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=pagadala.yesu.anjaneyulu@intel.com \
--cc=yedidya.ben.shimol@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox