2014-07-13 15:02:34

by Vladimir Kondratiev

[permalink] [raw]
Subject: GFP flags for cfg80211_rx_mgmt

Hi,

In the cfg80211_rx_mgmt(), there is parameter 'gfp_t gfp' that is
passed to the nl80211_send_mgmt() and then to alloc_skb().
In fact, nl80211_send_mgmt() called under spinlock, so
one can't use GFP_KERNEL. However, documentation for
cfg80211_rx_mgmt does not restrict GFP flags.

I suggest to document this, and enforce in some way (WARN_ONCE?),
or just remove this parameter - everywhere in the kernel
GFP_ATOMIC is used.

Thanks, Vladimir


2014-07-21 09:37:58

by Johannes Berg

[permalink] [raw]
Subject: Re: GFP flags for cfg80211_rx_mgmt

On Sun, 2014-07-13 at 08:02 -0700, Vladimir Kondratiev wrote:
> Hi,
>
> In the cfg80211_rx_mgmt(), there is parameter 'gfp_t gfp' that is
> passed to the nl80211_send_mgmt() and then to alloc_skb().
> In fact, nl80211_send_mgmt() called under spinlock, so
> one can't use GFP_KERNEL. However, documentation for
> cfg80211_rx_mgmt does not restrict GFP flags.
>
> I suggest to document this, and enforce in some way (WARN_ONCE?),
> or just remove this parameter - everywhere in the kernel
> GFP_ATOMIC is used.

I say just remove it, want to send a patch?

johannes


2014-08-10 08:13:23

by Vladimir Kondratiev

[permalink] [raw]
Subject: Re: GFP flags for cfg80211_rx_mgmt

On Monday, July 21, 2014 11:37:41 AM Johannes Berg wrote:
> On Sun, 2014-07-13 at 08:02 -0700, Vladimir Kondratiev wrote:
> > Hi,
> >
> > In the cfg80211_rx_mgmt(), there is parameter 'gfp_t gfp' that is
> > passed to the nl80211_send_mgmt() and then to alloc_skb().
> > In fact, nl80211_send_mgmt() called under spinlock, so
> > one can't use GFP_KERNEL. However, documentation for
> > cfg80211_rx_mgmt does not restrict GFP flags.
> >
> > I suggest to document this, and enforce in some way (WARN_ONCE?),
> > or just remove this parameter - everywhere in the kernel
> > GFP_ATOMIC is used.
>
> I say just remove it, want to send a patch?
>
> johannes
>
Yes, I will. Sorry for delay, was out (climbing some 7000m+ peak :-) )