mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
iscsi-target: return -EINVAL on oversized configfs parameter
The iSCSI CHAP auth parameters are already copied with respect for the destination buffer size. Return -EINVAL instead of silently truncating the input. Signed-off-by: Eric Seppanen <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
374b105797
commit
2306bfb208
1 changed files with 2 additions and 1 deletions
|
|
@ -474,7 +474,8 @@ static ssize_t __iscsi_##prefix##_store_##name( \
|
|||
\
|
||||
if (!capable(CAP_SYS_ADMIN)) \
|
||||
return -EPERM; \
|
||||
\
|
||||
if (count >= sizeof(auth->name)) \
|
||||
return -EINVAL; \
|
||||
snprintf(auth->name, sizeof(auth->name), "%s", page); \
|
||||
if (!strncmp("NULL", auth->name, 4)) \
|
||||
auth->naf_flags &= ~flags; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue