[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ihb8fr$jbj$1@dough.gmane.org>
Date: Fri, 21 Jan 2011 06:18:35 +0000 (UTC)
From: WANG Cong <xiyou.wangcong@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Do not potentially overflow string in sumversion
On Fri, 21 Jan 2011 00:00:56 +0100, Jesper Juhl wrote:
> In scripts/mod/sumversion.c (in get_src_version()) we call
> getenv("MODVERDIR"). This returns a pointer to a string of unknown
> length. This string of unknown length we then pass on as an argument to
> sprintf() and tell it to write the result to 'filelist' which has a,
> very much fixed, size of 'PATH_MAX + 1'. If the string returned by
> getenv() is too long we'll overrun the statically allocated buffer. This
> patch prevents the buffer overrun by using snprintf() and telling it to
> copy a maximum of 'PATH_MAX + 1' bytes (including the terminating \0).
>
> Signed-off-by: Jesper Juhl <jj@...osbits.net> ---
Acked-by: WANG Cong <xiyou.wangcong@...il.com>
Next time, please Cc linux-kbuild for kbuild changes.
Regards.
--
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