From: Nicholas Bellinger Date: Sat, 6 Jul 2013 23:48:55 +0000 (-0700) Subject: iscsi-target: Fix tfc_tpg_auth_cit configfs length overflow X-Git-Tag: upstream/snapshot3+hdmi~4711^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37b32c6faf0e0e40c65c1014df7527ececdd3f9a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git iscsi-target: Fix tfc_tpg_auth_cit configfs length overflow This patch fixes another potential buffer overflow while processing iscsi_node_auth input for configfs attributes in v3.11 for-next TPG tfc_tpg_auth_cit context. Reported-by: Joern Engel Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 88bc805..b41d478 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -1081,7 +1081,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 \