Re: [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event

2018-05-22 Thread Johannes Berg
On Mon, 2018-05-21 at 10:23 +0300, Dedy Lansky wrote: > > 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

RE: [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event

2018-05-21 Thread Dedy Lansky
> From: linux-wireless-ow...@vger.kernel.org > [mailto:linux-wireless-ow...@vger.kernel.org] On Behalf Of Johannes Berg > > On Thu, 2018-05-17 at 11:43 -0700, Jeff Johnson wrote: > > > > > - msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL); > > > + msg = nlmsg_new(100 + ft_event->ies_len

Re: [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event

2018-05-17 Thread Johannes Berg
On Thu, 2018-05-17 at 11:43 -0700, Jeff Johnson wrote: > > > - 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 reall

Re: [PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event

2018-05-17 Thread Jeff Johnson
On 2018-05-17 06:25, Dedy Lansky wrote: From: Dedy Lansky 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 t

[PATCH] nl80211: fix nlmsg allocation in cfg80211_ft_event

2018-05-17 Thread Dedy Lansky
From: Dedy Lansky 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-b