[lkml]   [2010]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] IPVS: replace sprintf to snprintf to avoid stack buffer overflow
On Tue, Apr 6, 2010 at 10:50 AM,  <> wrote:
> IPVS not check the length of pp->name, use sprintf will cause stack buffer overflow.
> struct ip_vs_protocol{} declare name as char *, if register a protocol as:
> struct ip_vs_protocol ip_vs_test = {
>        .name =                 "",
>        .debug_packet =         ip_vs_tcpudp_debug_packet,
> };
> when called ip_vs_tcpudp_debug_packet(), sprintf(buf, "%s TRUNCATED", pp->name);
> will cause stack buffer overflow.

Long messages will be truncated instead of buffer overflow. We need to
find a way to handle long messages elegantly.

Changli Gao(
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2010-04-06 05:01    [W:0.040 / U:0.740 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site