Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leak when ULP sleep ack is sent #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smanni-et
Copy link

An SKB buffer is allocated here to contain the
acknowledge to ULP sleep request but it is never freed.

This issue has been discovered with kmemleak reporting:

unreferenced object 0xbd931b40 (size 192):
comm "SDIO-RX-Thread", pid 115, jiffies 4294939787 (age 385.370s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<80128470>] kmem_cache_alloc+0x1c8/0x254
[<8072c2d8>] __build_skb+0x34/0x9c
[<8072c360>] build_skb+0x20/0x78
[<8072c43c>] __alloc_rx_skb+0x84/0xf4
[<8072c4d8>] __netdev_alloc_skb+0x2c/0x54
[<7f04e290>] rsi_send_ack_for_ulp_entry+0x28/0xa0 [rsi_91x]
[<7f052ad4>] rsi_mgmt_pkt_recv+0x4c0/0x10d0 [rsi_91x]
[<7f049ed4>] rsi_read_pkt+0x104/0x268 [rsi_91x]
[<7f070168>] rsi_sdio_rx_thread+0xa8/0x180 [rsi_sdio]
[<8005065c>] kthread+0xec/0x104
[<800107e8>] ret_from_fork+0x14/0x2c
[] 0xffffffff

In order to reproduce it just load the module and wait,
you will see the memory usage increasing rapidly.

Signed-off-by: Stefano Manni [email protected]

An SKB buffer is allocated here to contain the
acknowledge to ULP sleep request but it is never freed.

This issue has been discovered with kmemleak reporting:

unreferenced object 0xbd931b40 (size 192):
	comm "SDIO-RX-Thread", pid 115, jiffies 4294939787 (age 385.370s)
	hex dump (first 32 bytes):
		00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
		00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
	backtrace:
		[<80128470>] kmem_cache_alloc+0x1c8/0x254
		[<8072c2d8>] __build_skb+0x34/0x9c
		[<8072c360>] build_skb+0x20/0x78
		[<8072c43c>] __alloc_rx_skb+0x84/0xf4
		[<8072c4d8>] __netdev_alloc_skb+0x2c/0x54
		[<7f04e290>] rsi_send_ack_for_ulp_entry+0x28/0xa0 [rsi_91x]
		[<7f052ad4>] rsi_mgmt_pkt_recv+0x4c0/0x10d0 [rsi_91x]
		[<7f049ed4>] rsi_read_pkt+0x104/0x268 [rsi_91x]
		[<7f070168>] rsi_sdio_rx_thread+0xa8/0x180 [rsi_sdio]
		[<8005065c>] kthread+0xec/0x104
		[<800107e8>] ret_from_fork+0x14/0x2c
		[<ffffffff>] 0xffffffff

In order to reproduce it just load the module and wait,
you will see the memory usage increasing rapidly.

Signed-off-by: Stefano Manni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant