From: Jörn Engel Date: Wed, 3 Jul 2013 15:35:11 +0000 (-0400) Subject: iscsi-target: Fix tfc_tpg_nacl_auth_cit configfs length overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0fbfc46fb0b2f543a8b539e94c6c293ebc0b05a6;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git iscsi-target: Fix tfc_tpg_nacl_auth_cit configfs length overflow This patch fixes a potential buffer overflow while processing iscsi_node_auth input for configfs attributes within NodeACL tfc_tpg_nacl_auth_cit context. Signed-off-by: Joern Engel Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index e251849a6140..88bc805e998f 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -473,7 +473,7 @@ static ssize_t __iscsi_##prefix##_store_##name( \ if (!capable(CAP_SYS_ADMIN)) \ return -EPERM; \ \ - snprintf(auth->name, PAGE_SIZE, "%s", page); \ + snprintf(auth->name, sizeof(auth->name), "%s", page); \ if (!strncmp("NULL", auth->name, 4)) \ auth->naf_flags &= ~flags; \ else \