Spdk/test/unit/lib/nvmf/subsystem.c
Daniel Verkamp 8af4b6c40f nvmf: fix potential use-after-free in hot remove
The subsystem->ns array may be resized with realloc(), so old ns
pointers can become invalid.

To fix this, allocate each ns as a separate object, and change the
subsystem->ns[] array to point to the namespaces rather than containing
them.

Change-Id: I873502fa90cf840e4eaa9b1abd94a95afe0f737f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399726
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-02-16 13:06:11 -05:00
..
.gitignore test: move NVMe-oF library tests to test/unit 2017-06-21 16:51:12 -04:00
Makefile test: use spdk.unittest.mk for nvmf unit tests 2018-02-14 10:40:40 -05:00
subsystem_ut.c nvmf: fix potential use-after-free in hot remove 2018-02-16 13:06:11 -05:00