From: Prarit Bhargava Date: Thu, 17 Oct 2013 12:00:11 +0000 (-0400) Subject: powerpc/vio: use strcpy in modalias_show X-Git-Tag: v3.13-rc1~20^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=411cabf79e684171669ad29a0628c400b4431e95;p=profile%2Fcommon%2Fkernel-common.git powerpc/vio: use strcpy in modalias_show Commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 used strcat instead of strcpy which can result in an overflow of newlines on the buffer. Signed-off-by: Prarit Bhargava Cc: benh@kernel.crashing.org Cc: ben@decadent.org.uk Cc: stable@vger.kernel.org Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index d38cc08..cb92d82 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c @@ -1531,12 +1531,12 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, dn = dev->of_node; if (!dn) { - strcat(buf, "\n"); + strcpy(buf, "\n"); return strlen(buf); } cp = of_get_property(dn, "compatible", NULL); if (!cp) { - strcat(buf, "\n"); + strcpy(buf, "\n"); return strlen(buf); }