[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101005114449.GI5170@cr0.nay.redhat.com>
Date: Tue, 5 Oct 2010 19:44:49 +0800
From: Américo Wang <xiyou.wangcong@...il.com>
To: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@...ia.com>
Cc: akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
phillip@...gher.demon.co.uk, hsweeten@...ionengravers.com,
hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] initramfs: strcpy destination string overflow
On Tue, Oct 05, 2010 at 12:44:17PM +0400, Evgeny Kuznetsov wrote:
>From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@...ia.com>
>
>Function "strcpy()" is used without check for maximum allowed
>source string length and could cause destination string overflow.
>"strcpy()" is replaced by "strlcpy()" to prevent destination
>string overflow.
>
>Signed-off-by: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@...ia.com>
Looks good to me,
Reviewed-by: WANG Cong <xiyou.wangcong@...il.com>
>---
> init/initramfs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/init/initramfs.c b/init/initramfs.c
>index 4b9c202..3e68568 100644
>--- a/init/initramfs.c
>+++ b/init/initramfs.c
>@@ -56,7 +56,7 @@ static char __init *find_link(int major, int minor, int ino,
> q->minor = minor;
> q->ino = ino;
> q->mode = mode;
>- strcpy(q->name, name);
>+ strlcpy(q->name, name, sizeof(q->name));
> q->next = NULL;
> *p = q;
> return NULL;
>--
>1.6.3.3
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@...r.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists