linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Johnson <quic_jjohnson@quicinc.com>
To: <gregory.greenman@intel.com>, <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>,
	Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Subject: Re: [PATCH 14/16] wifi: mac80211: Modify type of "changed" variable.
Date: Sat, 2 Dec 2023 09:56:56 -0800	[thread overview]
Message-ID: <4baf4dcd-26e5-47d6-bb17-4e23ccc8c12d@quicinc.com> (raw)
In-Reply-To: <20230604120651.10354a05eaf1.If19359262fe2728dd523ea6d7c3aa7dc50940411@changeid>

On 6/4/2023 2:11 AM, gregory.greenman@intel.com wrote:
> From: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
> 
> Currently, enum ieee80211_bss_change has more than 32 flags.
> Change the type of the corresponding variables from u32 to u64.
> 
> Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
> ---
>  net/mac80211/cfg.c         | 79 ++++++++++++++++++--------------------
>  net/mac80211/chan.c        |  4 +-
>  net/mac80211/ibss.c        | 16 ++++----
>  net/mac80211/ieee80211_i.h | 14 ++++---
>  net/mac80211/iface.c       |  4 +-
>  net/mac80211/main.c        |  4 +-
>  net/mac80211/mesh.c        | 30 ++++++++-------
>  net/mac80211/mesh.h        | 19 ++++-----
>  net/mac80211/mesh_plink.c  | 37 +++++++++---------
>  net/mac80211/mesh_ps.c     |  7 ++--
>  net/mac80211/mlme.c        | 12 +++---
>  net/mac80211/ocb.c         |  4 +-
>  12 files changed, 119 insertions(+), 111 deletions(-)

We are finally at the point where we are testing mesh and this patch is
breaking mesh on 32-bit systems. There seems to be a fundamental issue
with both the original code and the revised code where bitop operations
are being used on bitmaps which have not been defined and sized with
DECLARE_BITMAP.

Note the bitops all use unsigned long * for the bitmap pointer, and
hence it seems important that all the bitmaps being used with these
operations use that same underlying type.

The specific code that is causing us issues is in
ieee80211_mbss_info_change_notify():
	for_each_set_bit(bit, &bits, sizeof(changed) * BITS_PER_BYTE)
		set_bit(bit, ifmsh->mbss_changed);

Here in the current code changed is u64 and ifmsh->mbss_changed is
unsigned long and hence processing a bit > 32 writes outside
ifmsh->mbss_changed on a 32-bit system.

At a minimum struct ieee80211_if_mesh::mbss_changed needs to be properly
sized.

We have validated what I consider to be a quick and dirty change which
modifies struct ieee80211_if_mesh::mbss_changed from unsigned long to u64.

Do you want that change?

Or do you want to propose an encompassing solution that correctly uses
unsigned long * and DECLARE_BOTMAP


/jeff


  reply	other threads:[~2023-12-02 17:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04  9:11 [PATCH 00/16] cfg80211/mac80211 patches from our internal tree 2023-06-04 gregory.greenman
2023-06-04  9:11 ` [PATCH 01/16] wifi: mac80211: use u64 to hold enum ieee80211_bss_change flags gregory.greenman
2023-06-04  9:11 ` [PATCH 02/16] wifi: mac80211: refactor ieee80211_select_link_key() gregory.greenman
2023-06-04  9:11 ` [PATCH 03/16] wifi: mac80211: don't translate beacon/presp addrs gregory.greenman
2023-06-04  9:11 ` [PATCH 04/16] wifi: mac80211: mlme: fix non-inheritence element gregory.greenman
2023-06-04  9:11 ` [PATCH 05/16] wifi: mac80211: provide a helper to fetch the medium synchronization delay gregory.greenman
2023-06-04  9:11 ` [PATCH 06/16] wifi: cfg80211: reject bad AP MLD address gregory.greenman
2023-06-04  9:11 ` [PATCH 07/16] wifi: mac80211_hwsim: check the return value of nla_put_u32 gregory.greenman
2023-06-04  9:11 ` [PATCH 08/16] wifi: mac80211: recalc min chandef for new STA links gregory.greenman
2023-06-04  9:11 ` [PATCH 09/16] wifi: mac80211: move sta_info_move_state() up gregory.greenman
2023-06-04  9:11 ` [PATCH 10/16] wifi: mac80211: batch recalc during STA flush gregory.greenman
2023-06-04  9:11 ` [PATCH 11/16] wifi: mac80211: use correct iftype HE cap gregory.greenman
2023-06-04  9:11 ` [PATCH 12/16] wifi: mac80211: add helpers to access sband iftype data gregory.greenman
2023-06-04  9:11 ` [PATCH 13/16] wifi: mac80211: remove typecast in a call to ieee80211_config_bw() gregory.greenman
2023-06-06 13:18   ` Nicolas Escande
2023-06-06 13:22     ` Johannes Berg
2023-06-04  9:11 ` [PATCH 14/16] wifi: mac80211: Modify type of "changed" variable gregory.greenman
2023-12-02 17:56   ` Jeff Johnson [this message]
2023-12-03 16:48     ` Jeff Johnson
2023-12-03 18:42       ` Johannes Berg
2023-06-04  9:11 ` [PATCH 15/16] wifi: mac80211_hwsim: Fix possible NULL dereference gregory.greenman
2023-06-04  9:11 ` [PATCH 16/16] wifi: mac80211: stop warning after reconfig failures gregory.greenman

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=4baf4dcd-26e5-47d6-bb17-4e23ccc8c12d@quicinc.com \
    --to=quic_jjohnson@quicinc.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pagadala.yesu.anjaneyulu@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;
as well as URLs for NNTP newsgroup(s).