nvme: fix several bugs in nvme-fabric
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nvme: fix delete uninitialized controllerdrivers/ | +2 | 3 replies | |
| 2/4 | nvme: fix reset uninitialized controllerdrivers/ | +19 | 1 reply | |
| 3/4 | nvmet: fix hang in nvmet_ns_disable()drivers/ drivers/ drivers/ | +20 | 3 replies | |
| 4/4 | nvmet-tcp: fix memory leak in nvmet_tcp_free_cmd_data_in_buffers()drivers/ | +3 | 2 replies |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by.
| Patch | Sagi Grimberg |
|---|---|
| 1/4 | |
| 2/4 | |
| 3/4 | R-b |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] nvme: fix several bugs in nvme-fabric
There are several race conditions in the nvme-fabric scenario. It fixes these bugs as well as a memory leak.
The first patch fixes kernel panic in delete controller logic because of dereference of an uninitialized controller.
Currently, controllers can be deleted with the sysfs.
It should be disallowed before controller initialization. But it is allowed always.
So, the delete controller logic possibly accesses uninitialized controller resources, which results in kernel panic.
The second patch fixes kernel panic in reset controller logic because of dereference of an uninitialized controller.
This issue is very similar to the first issue.
The solution is very similar too.
It prevents resetting controllers before the initialization of the nvme controller.
The third patch fixes a race condition between nvmet_ns_disable() and nvmet_ns_enable()nvmet_ns_enable() and nvmet_ns_disable() should not be worked concurrently. But, it is possible.
So, hang occurs in the nvmet_ns_disable() due to a race condition.
The last patch fixes a memory leak when a tcp target is released. When a host sends a reset command to the target, a target calls nvmet_tcp_free_cmd_data_in_buffers() to free resources in the CMD. It internally possibly skips freeing resources due to some condition. At this point, a memory leak would occur.
Taehee Yoo (4):
nvme: fix delete uninitialized controller
nvme: fix reset uninitialized controller
nvmet: fix hang in nvmet_ns_disable()
nvmet-tcp: fix memory leak in nvmet_tcp_free_cmd_data_in_buffers()
drivers/nvme/host/core.c | 31 +++++++++++++++++++++---------- drivers/nvme/target/configfs.c | 14 +++++++------- drivers/nvme/target/core.c | 10 ++++++---- drivers/nvme/target/nvmet.h | 8 +++++++- drivers/nvme/target/tcp.c | 9 +++------ 5 files changed, 44 insertions(+), 28 deletions(-)
Signature · 1 line
2.34.1