mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 09:44:18 +08: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 <eric@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
374b105797
commit
2306bfb208
@ -474,7 +474,8 @@ static ssize_t __iscsi_##prefix##_store_##name( \
|
|||||||
\
|
\
|
||||||
if (!capable(CAP_SYS_ADMIN)) \
|
if (!capable(CAP_SYS_ADMIN)) \
|
||||||
return -EPERM; \
|
return -EPERM; \
|
||||||
\
|
if (count >= sizeof(auth->name)) \
|
||||||
|
return -EINVAL; \
|
||||||
snprintf(auth->name, sizeof(auth->name), "%s", page); \
|
snprintf(auth->name, sizeof(auth->name), "%s", page); \
|
||||||
if (!strncmp("NULL", auth->name, 4)) \
|
if (!strncmp("NULL", auth->name, 4)) \
|
||||||
auth->naf_flags &= ~flags; \
|
auth->naf_flags &= ~flags; \
|
||||||
|
Loading…
Reference in New Issue
Block a user