All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Pkshih <pkshih@realtek.com>
Subject: Re: Memory leak in ieee80211_rx_napi()
Date: Fri, 9 Apr 2021 16:25:52 -0500	[thread overview]
Message-ID: <a5bc42af-3b76-8e31-4538-e81b3a33b4f2@lwfinger.net> (raw)
In-Reply-To: <82a7c6c9bcbe923906276e8aa26a9a783598a0d7.camel@sipsolutions.net>

On 4/9/21 2:31 PM, Johannes Berg wrote:
> Hi Larry,
> 
>> What setting or lack of, would cause ieee80211_rx_napi() to leak the skb that it
>> is given? The documentation states that once this call is made, mac80211 owns
>> this buffer. Does this mean that it will also be freed?
> 
> Eventually, yes. But it might go onto a NAPI GRO list, etc. Perhaps it
> might even look like it's leaked if it's on such a list if you didn't
> implement NAPI properly as polling, but just call ieee80211_rx_napi()
> with a non-NULL napi struct pointer.
> 
> That said, of course there might be bugs in mac80211 where it actually
> leaks the skb.
> 
> How are you determining that it's being leaked?
> 
> johannes
> 

I use kmemleak. They are real leaks as they persist after the rtw drivers are 
unloaded.

The call is ieee80211_rx_napi(rtwdev->hw, NULL, new, napi); I added a test for 
napi == NULL. None failed.

Is it possible that the NULL for struct ieee80211_sta would screw it up? I see 
that most of the Intel drivers use a non-NULL argument.

Would a "Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b1] 
(rev 73)" use napi? If so, iwlmvm does not leak anything. I do not have any 
other devices that use napi.

Larry




  reply	other threads:[~2021-04-09 21:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 15:23 Memory leak in ieee80211_rx_napi() Larry Finger
2021-04-09 19:31 ` Johannes Berg
2021-04-09 21:25   ` Larry Finger [this message]
2021-04-11 19:17   ` Larry Finger
2021-04-12 11:53     ` 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=a5bc42af-3b76-8e31-4538-e81b3a33b4f2@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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.