linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Johnson <jjohnson@codeaurora.org>
To: 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: Thu, 17 May 2018 11:43:12 -0700	[thread overview]
Message-ID: <a19275473776283a94997b8f5436f3b9@codeaurora.org> (raw)
In-Reply-To: <000901d3ede2$78a3aa20$69eafe60$@codeaurora.org>

On 2018-05-17 06:25, Dedy Lansky wrote:
> From: Dedy Lansky <dlansky@codeaurora.org>
> 
> Allocation size of nlmsg in cfg80211_ft_event is based on ric_ies_len
> and doesn't take into account ies_len. This leads to
> NL80211_CMD_FT_EVENT message construction failure in case ft_event
> contains large enough ies buffer.
> Add ies_len to the nlmsg allocation size.
> 
> Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
> ---
>  net/wireless/nl80211.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index afbe510..64afd04 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -15755,7 +15755,8 @@ void cfg80211_ft_event(struct net_device 
> *netdev,
>  	if (!ft_event->target_ap)
>  		return;
> 
> -	msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL);
> +	msg = nlmsg_new(100 + ft_event->ies_len + ft_event->ric_ies_len,
> +			GFP_KERNEL);
>  	if (!msg)
>  		return;

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 
header + padding? or do we consider that to be noise captured by the 
"100"?

  reply	other threads:[~2018-05-17 18:43 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 [this message]
2018-05-17 19:29   ` Johannes Berg
2018-05-21  7:23     ` Dedy Lansky
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=a19275473776283a94997b8f5436f3b9@codeaurora.org \
    --to=jjohnson@codeaurora.org \
    --cc=dlansky@codeaurora.org \
    --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).