linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dedy Lansky" <dlansky@codeaurora.org>
To: "'Johannes Berg'" <johannes@sipsolutions.net>,
	"'Jeff Johnson'" <jjohnson@codeaurora.org>,
	"'Dedy Lansky'" <dlansky@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>, <linux-wireless-owner@vger.kernel.org>
Subject: RE: [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event
Date: Mon, 21 May 2018 10:23:07 +0300	[thread overview]
Message-ID: <001201d3f0d4$93258900$b9709b00$@codeaurora.org> (raw)
In-Reply-To: <1526585345.5351.3.camel@sipsolutions.net>

> From: linux-wireless-owner@vger.kernel.org =
[mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Johannes Berg
>
> On Thu, 2018-05-17 at 11:43 -0700, Jeff Johnson wrote:
> >=20
> > > -	msg =3D nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL);
> > > +	msg =3D nlmsg_new(100 + ft_event->ies_len + =
ft_event->ric_ies_len,
> > > +			GFP_KERNEL);
> > >  	if (!msg)
> > >  		return;
> >=20
> > should these really be nla_total_size(ft_event->ies_len) +
> > nla_total_size(ft_event->ric_ies_len) to properly account for the =
NLA=20
> > header + padding? or do we consider that to be noise captured by the =

> > "100"?
>
> We do, technically we should have something like nla_total_size() of =
various things including all those wiphy, ifindex, MAC attributes etc.
> so we just get lazy...

nla_total_size is currently not used in nl80211.c (actually not used in =
net\wireless\ for that matters).
IMO, switching nl80211/cfg80211 to use nla_total_size should be done =
separately.
This patch is for fixing a very specific and small bug. Using =
nla_total_size in a single function in the file (cfg80211_ft_event) =
would be awkward.

Thanks,
 Dedy.

  reply	other threads:[~2018-05-21  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 13:25 [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event Dedy Lansky
2018-05-17 18:43 ` Jeff Johnson
2018-05-17 19:29   ` Johannes Berg
2018-05-21  7:23     ` Dedy Lansky [this message]
2018-05-22  9:00       ` Johannes Berg

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='001201d3f0d4$93258900$b9709b00$@codeaurora.org' \
    --to=dlansky@codeaurora.org \
    --cc=jjohnson@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless-owner@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).