All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lin <yu-hao.lin@nxp.com>
To: David Lin <yu-hao.lin@nxp.com>, Brian Norris <briannorris@chromium.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvalo@kernel.org" <kvalo@kernel.org>,
	"francesco@dolcini.it" <francesco@dolcini.it>,
	Pete Hsieh <tsung-hsien.hsieh@nxp.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>
Subject: RE: [EXT] Re: [PATCH v9 2/2] wifi: mwifiex: add host mlme for AP mode
Date: Thu, 18 Apr 2024 03:37:35 +0000	[thread overview]
Message-ID: <PA4PR04MB9638A61A144364C3567AEA76D10E2@PA4PR04MB9638.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <PA4PR04MB9638D5722670E38B5691B948D12D2@PA4PR04MB9638.eurprd04.prod.outlook.com>

> From: David Lin <yu-hao.lin@nxp.com>
> Sent: Monday, March 18, 2024 10:04 AM
> To: Brian Norris <briannorris@chromium.org>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> kvalo@kernel.org; francesco@dolcini.it; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>; Francesco Dolcini
> <francesco.dolcini@toradex.com>
> Subject: RE: [EXT] Re: [PATCH v9 2/2] wifi: mwifiex: add host mlme for AP
> mode
> > 
> > From: Brian Norris <briannorris@chromium.org>
> > Sent: Saturday, March 16, 2024 8:45 AM
> > To: David Lin <yu-hao.lin@nxp.com>
> > Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> > kvalo@kernel.org; francesco@dolcini.it; Pete Hsieh
> > <tsung-hsien.hsieh@nxp.com>; Francesco Dolcini
> > <francesco.dolcini@toradex.com>
> > Subject: [EXT] Re: [PATCH v9 2/2] wifi: mwifiex: add host mlme for AP
> > mode
> >
> > Caution: This is an external email. Please take care when clicking
> > links or opening attachments. When in doubt, report the message using
> > the 'Report this email' button
> >
> >
> > On Wed, Mar 06, 2024 at 10:00:53AM +0800, David Lin wrote:
> > > Add host based MLME to enable WPA3 functionalities in AP mode.
> > > This feature required a firmware with the corresponding V2 Key API
> > > support. The feature (WPA3) is currently enabled and verified only
> > > on IW416. Also, verified no regression with change when host MLME is
> > > disabled.
> > >
> > > Signed-off-by: David Lin <yu-hao.lin@nxp.com>
> > > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> >
> > Quick pass for now; nothing jumps out at me today, but I'll give a
> > better look/Ack next week:
> >
> > > --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> > > +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> >
> >
> > > @@ -3951,12 +3974,43 @@
> > mwifiex_cfg80211_tdls_cancel_chan_switch(struct wiphy *wiphy,
> > >       }
> > >  }
> > >
> > > +static int
> > > +mwifiex_cfg80211_uap_add_station(struct mwifiex_private *priv,
> > > +const u8
> > *mac,
> > > +                              struct station_parameters *params) {
> > > +     struct mwifiex_sta_info add_sta;
> > > +     int ret;
> > > +
> > > +     memcpy(add_sta.peer_mac, mac, ETH_ALEN);
> > > +     add_sta.params = params;
> > > +
> > > +     ret = mwifiex_send_cmd(priv, HostCmd_CMD_ADD_NEW_STATION,
> > > +                            HostCmd_ACT_ADD_STA, 0, (void
> > *)&add_sta,
> > > + true);
> > > +
> > > +     if (!ret) {
> > > +             struct station_info *sinfo;
> > > +
> > > +             sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
> >
> > Couldn't this just be stack allocation?
> >
> >                 struct staion_info sinfo;
> >
> >                 cfg80211_new_sta(priv->netdev, mac, &sinfo,
> > GFP_KERNEL);
> >
> > I'm not sure you need to kzalloc() something here, if you're freeing
> > it a few lines later.
> >
> 
> Will modify it in patch v10.
> 

This modification will let stack overflow. Patch v10 will keep original code.

> >
> > > +             if (!sinfo)
> > > +                     return -ENOMEM;
> > > +
> > > +             cfg80211_new_sta(priv->netdev, mac, sinfo,
> GFP_KERNEL);
> > > +             kfree(sinfo);
> > > +     }
> > > +
> > > +     return ret;
> > > +}
> >
> > Brian


  reply	other threads:[~2024-04-18  3:37 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  2:00 [PATCH v9 0/2] wifi: mwifiex: add code to support host mlme David Lin
2024-03-06  2:00 ` [PATCH v9 1/2] wifi: mwifiex: add host mlme for client mode David Lin
2024-03-16  0:00   ` Brian Norris
2024-03-18  2:00     ` [EXT] " David Lin
2024-03-18 11:41       ` Francesco Dolcini
2024-03-19  1:36         ` [EXT] " David Lin
2024-03-06  2:00 ` [PATCH v9 2/2] wifi: mwifiex: add host mlme for AP mode David Lin
2024-03-16  0:45   ` Brian Norris
2024-03-18  2:04     ` [EXT] " David Lin
2024-04-18  3:37       ` David Lin [this message]
2024-03-15  9:49 ` [PATCH v9 0/2] wifi: mwifiex: add code to support host mlme Francesco Dolcini
2024-03-15 23:59   ` Brian Norris
2024-03-18 11:28     ` Francesco Dolcini
2024-03-19 10:33       ` Kalle Valo
2024-03-20 21:06         ` Brian Norris
2024-03-16  0:49   ` Brian Norris
2024-03-19 12:12     ` Johannes Berg
2024-03-20  0:59       ` [EXT] " David Lin
2024-03-20  1:10         ` David Lin
2024-03-20  9:12           ` Johannes Berg
2024-03-20 21:50             ` Brian Norris
2024-03-21  4:07               ` David Lin
2024-03-23  1:06                 ` Brian Norris
2024-03-25 16:15                   ` Johannes Berg
2024-03-29 10:06                     ` David Lin
2024-04-02 17:38                       ` Brian Norris
2024-04-10  7:30                         ` David Lin
2024-04-10  7:55                           ` Johannes Berg
2024-04-10 10:33                             ` David Lin
2024-04-10 17:56                               ` Johannes Berg
2024-04-11  7:57                                 ` David Lin
2024-04-11  8:02                                   ` Johannes Berg
2024-04-10  7:52                         ` Johannes Berg
2024-03-25 15:58               ` Johannes Berg
2024-03-29  9:58                 ` David Lin
2024-03-18  9:24   ` Kalle Valo
2024-03-19  1:40     ` [EXT] " David Lin
2024-03-20 21:28     ` Brian Norris
2024-03-21  2:14       ` [EXT] " David Lin
2024-03-16  0:07 ` Brian Norris
2024-03-18  2:20   ` [EXT] " David Lin
2024-03-18 11:45     ` Francesco Dolcini
2024-03-20 21:13     ` Brian Norris
2024-03-21  2:12       ` David Lin

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=PA4PR04MB9638A61A144364C3567AEA76D10E2@PA4PR04MB9638.eurprd04.prod.outlook.com \
    --to=yu-hao.lin@nxp.com \
    --cc=briannorris@chromium.org \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tsung-hsien.hsieh@nxp.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.