Closed GustavoARSilva closed 1 year ago
srp_rsp is a pointer to a flexible structure (a structure that contains a trailing flexible-array member). Use the flexible-array member as destination in memcpy(), explicitly.
include/scsi/srp.h: 256 struct srp_rsp { 257 u8 opcode; 258 u8 sol_not; ... 267 __be32 sense_data_len; 268 __be32 resp_data_len; 269 u8 data[]; 270 };
drivers/infiniband/ulp/srpt/ib_srpt.c: 1424 memcpy(srp_rsp + 1, sense_data, sense_data_len);
Reported-by: https://github.com/HBh25Y
Hi, I send a patch for this: https://lore.kernel.org/all/20220909022943.8896-1-hbh25y@gmail.com/T/#u
Awesome. Thanks!
srp_rsp is a pointer to a flexible structure (a structure that contains a trailing flexible-array member). Use the flexible-array member as destination in memcpy(), explicitly.
Reported-by: https://github.com/HBh25Y