aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_in.c
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <[email protected]>2023-02-14 09:50:16 +0900
committerMartin K. Petersen <[email protected]>2023-02-21 22:00:50 -0500
commitfb428a2005fc1260d18b989cc5199f281617f44d (patch)
tree79f3f508303f2ed6bf0bf3c2d10f7b73739b1161 /net/lapb/lapb_in.c
parentae7d45f5283d30274039b95d3e6d53d33c66e991 (diff)
scsi: mpi3mr: Fix issues in mpi3mr_get_all_tgt_info()
The function mpi3mr_get_all_tgt_info() has four issues: 1) It calculates valid entry length in alltgt_info assuming the header part of the struct mpi3mr_device_map_info would equal to sizeof(u32). The correct size is sizeof(u64). 2) When it calculates the valid entry length kern_entrylen, it excludes one entry by subtracting 1 from num_devices. 3) It copies num_device by calling memcpy(). Substitution is enough. 4) It does not specify the calculated length to sg_copy_from_buffer(). Instead, it specifies the payload length which is larger than the alltgt_info size. It causes "BUG: KASAN: slab-out-of-bounds". Fix the issues by using the correct header size, removing the subtraction from num_devices, replacing the memcpy() with substitution and specifying the correct length to sg_copy_from_buffer(). Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Fixes: f5e6d5a34376 ("scsi: mpi3mr: Add support for driver commands") Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Acked-by: Sathya Prakash Veerichetty <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'net/lapb/lapb_in.c')
0 files changed, 0 insertions, 0 deletions