[scsi-1130]scsi: scsi_transport_sas: Fix memory leak when removing devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kunpeng920 |
Fix Released
|
Undecided
|
Ike Panhc | ||
Ubuntu-18.04 |
Invalid
|
Undecided
|
Unassigned | ||
Ubuntu-18.04-hwe |
Fix Released
|
Undecided
|
Ike Panhc | ||
Ubuntu-19.04 |
Won't Fix
|
Undecided
|
Unassigned | ||
Ubuntu-19.10 |
Won't Fix
|
Undecided
|
Unassigned | ||
Ubuntu-20.04 |
Fix Released
|
Undecided
|
Ike Panhc | ||
Upstream-kernel |
Fix Released
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Ike Panhc |
Bug Description
[Impact]
kmemleak detects potential leaks and this is the fix
[Test Case]
Not known case, regression test on system with SAS host is needed.
[Fix]
82ea3e0e12 scsi: scsi_transport_sas: Fix memory leak when removing devices
[Regression Risk]
Patch is simple and reviewed on upstream. Since modification is for scsi subsystem not on a single driver, applying on focal gives us enough time for test.
"[Steps to reproduce]
Enable memleak, and do as follows:
root@(none)$ echo 0 > /sys/devices/
[ 79.857888] hisi_sas_v2_hw HISI0162:01: dev[7:1] is gone
root@(none)$ echo scan > /sys/kernel/
[ 131.656603] kmemleak: 3 new suspected memory leaks (see /sys/kernel/
root@(none)$ more /sys/kernel/
unreferenced object 0xffff041da5c66000 (size 256):
comm ""kworker/u128:1"", pid 549, jiffies 4294898543 (age 113.728s)
hex dump (first 32 bytes):
00 5e c6 a5 1d 04 ff ff 01 00 00 00 00 00 00 00 .^..............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
unreferenced object 0xffff041d8c075400 (size 128):
comm ""kworker/u128:1"", pid 549, jiffies 4294898543 (age 113.728s)
hex dump (first 32 bytes):
00 40 25 97 1d 00 ff ff 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:
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
unreferenced object 0xffff041da5c65e00 (size 256):
comm ""kworker/u128:1"", pid 549, jiffies 4294898543 (age 113.728s)
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:
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
[<(
root@(none)$
[solution]
Fix by doing the queue removal in one place - in sas_rphy_remove() -
instead of unregistering the queue in sas_rphy_remove() and finally
cleaning up the queue in calling blk_cleanup_queue() from
sas_end_
Function bsg_remove_queue() can handle a NULL pointer q, so remove the
precheck in sas_rphy_remove().
"
scsi: scsi_transport_sas: Fix memory leak when removing devices
CVE References
Changed in kunpeng920: | |
status: | New → Incomplete |
Changed in linux (Ubuntu): | |
status: | New → Triaged |
assignee: | nobody → Ike Panhc (ikepanhc) |
tags: | added: ikeradar |
Changed in kunpeng920: | |
status: | Triaged → In Progress |
Changed in linux (Ubuntu): | |
status: | Triaged → In Progress |
description: | updated |
tags: | removed: ikeradar |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in kunpeng920: | |
status: | In Progress → Fix Committed |
Not yet hit upstream/master.