[PATCH AUTOSEL for 4.4 023/162] scsi: csiostor: Avoid content leaks and casts

2018-04-08 Thread Sasha Levin
From: Kees Cook [ Upstream commit 42c335f7e67029d2e01711f2f2bc6252277c8993 ] When copying attributes, the len argument was padded out and the resulting memcpy() would copy beyond the end of the source buffer. Avoid this, and use size_t for val_len to avoid all the casts.

[PATCH AUTOSEL for 4.4 023/162] scsi: csiostor: Avoid content leaks and casts

2018-04-08 Thread Sasha Levin
From: Kees Cook [ Upstream commit 42c335f7e67029d2e01711f2f2bc6252277c8993 ] When copying attributes, the len argument was padded out and the resulting memcpy() would copy beyond the end of the source buffer. Avoid this, and use size_t for val_len to avoid all the casts. Similarly, avoid source