All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Arend van Spriel <aspriel@gmail.com>,
	Johannes Berg <johannes.berg@intel.com>
Cc: linux-wireless@vger.kernel.org
Subject: 4.18.16: memory leak in sta_set_sinfo
Date: Mon, 22 Oct 2018 10:02:14 +0200	[thread overview]
Message-ID: <20181022080214.GA6379@sig21.net> (raw)

Hi,

I used 4.18.11 for a while and noticed a memleak showing
in slabtop as kmalloc-2048.  Then I updated to 4.18.16
and enabled kmemleak, it dumps this:

unreferenced object 0xffffa10a5cc49800 (size 2048):
  comm "conky", pid 2734, jiffies 4295635396 (age 454.650s)
  hex dump (first 32 bytes):
    1e 00 00 00 00 00 00 00 ad 13 00 00 00 00 00 00  ................
    a1 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000b7b13d1a>] sta_set_sinfo+0x634/0x900 [mac80211]
    [<00000000a74db622>] ieee80211_get_station+0x50/0x70 [mac80211]
    [<0000000039cfbb15>] cfg80211_wireless_stats+0x103/0x350 [cfg80211]
    [<000000003e9c0192>] iw_handler_get_iwstats+0x3b/0x90
    [<0000000058160332>] ioctl_standard_iw_point+0xef/0x370
    [<000000008af7fc78>] ioctl_standard_call+0x9d/0xb0
    [<000000009ad7a410>] wext_handle_ioctl+0x99/0xf0
    [<000000006bc483dc>] sock_ioctl+0x1b5/0x330
    [<000000004a40c83b>] do_vfs_ioctl+0xa4/0x620
    [<00000000c498918f>] ksys_ioctl+0x3a/0x70
    [<00000000033ccded>] __x64_sys_ioctl+0x16/0x20
    [<0000000038d98ffe>] do_syscall_64+0x56/0x110
    [<00000000913ebc09>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [<00000000b4781b29>] 0xffffffffffffffff
unreferenced object 0xffffa10a5cc4c000 (size 2048):
  comm "conky", pid 2734, jiffies 4295635396 (age 454.650s)
  hex dump (first 32 bytes):
    1e 00 00 00 00 00 00 00 ad 13 00 00 00 00 00 00  ................
    a1 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000b7b13d1a>] sta_set_sinfo+0x634/0x900 [mac80211]
    [<00000000a74db622>] ieee80211_get_station+0x50/0x70 [mac80211]
    [<000000009fd8a7aa>] cfg80211_wext_giwrate+0x111/0x2b0 [cfg80211]
    [<0000000045f8e84f>] ioctl_standard_call+0x4d/0xb0
    [<000000009ad7a410>] wext_handle_ioctl+0x99/0xf0
    [<000000006bc483dc>] sock_ioctl+0x1b5/0x330
    [<000000004a40c83b>] do_vfs_ioctl+0xa4/0x620
    [<00000000c498918f>] ksys_ioctl+0x3a/0x70
    [<00000000033ccded>] __x64_sys_ioctl+0x16/0x20
    [<0000000038d98ffe>] do_syscall_64+0x56/0x110
    [<00000000913ebc09>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [<00000000b4781b29>] 0xffffffffffffffff

etc.

sta_set_sinfo+0x634/0x900 seemt to be the call to
cfg80211_sinfo_alloc_tid_stats().


dmesg:

[ 2975.537043] kmemleak: 1223 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 3140.960503] kmemleak: 851 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 3755.462385] kmemleak: 280 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 4369.876913] kmemleak: 1011 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 4984.711904] kmemleak: 1002 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 5598.838136] kmemleak: 1023 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 6213.236272] kmemleak: 1088 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 6833.692160] kmemleak: 1004 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
[ 7447.151259] kmemleak: 1147 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

I guess it relates to
0fdf1493b41 " mac80211: allocate and fill tidstats only when needed"
which Fixes: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info")


Johannes

             reply	other threads:[~2018-10-22  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22  8:02 Johannes Stezenbach [this message]
2018-10-22  8:25 ` 4.18.16: memory leak in sta_set_sinfo Johannes Berg
2018-10-22  8:35   ` Johannes Stezenbach
2018-10-22  8:37     ` Johannes Berg
2018-10-22 10:48       ` Arend van Spriel
2018-10-23 11:59         ` Kalle Valo

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=20181022080214.GA6379@sig21.net \
    --to=js@sig21.net \
    --cc=aspriel@gmail.com \
    --cc=johannes.berg@intel.com \
    --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 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.