Re: [RFC v1 1/4] nvmet-trace: avoid dereferencing pointer too early

From: Hannes Reinecke
Date: Wed Sep 06 2023 - 07:00:50 EST


On 8/29/23 11:13, Daniel Wagner wrote:
The first command issued from the host to the target is the fabrics
connect command. At this point, neither the target queue nor the
controller have been allocated. But we already try to trace this command
in nvmet_req_init.

Reported by KASAN.

Signed-off-by: Daniel Wagner <dwagner@xxxxxxx>

---
drivers/nvme/target/trace.c | 6 +++---
drivers/nvme/target/trace.h | 24 +++++++++++++-----------
2 files changed, 16 insertions(+), 14 deletions(-)

Reviewed-by: Hannes Reinecke <hare@xxxxxxx>

Cheers,

Hannes