]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipmr: limit MRT_TABLE identifiers
authorEric Dumazet <edumazet@google.com>
Sun, 25 Nov 2012 09:44:29 +0000 (09:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Nov 2012 22:36:59 +0000 (17:36 -0500)
commitd45f521661f9a34e05c3635e6aed32294f369bb2
treedf232ca487f9abb44f5be051addfe7bc8d96f484
parent441e54bc3a8b61a5c2724b67cecf5edda28a238f
net: ipmr: limit MRT_TABLE identifiers

Name of pimreg devices are built from following format :

char name[IFNAMSIZ]; // IFNAMSIZ == 16

sprintf(name, "pimreg%u", mrt->id);

We must therefore limit mrt->id to 9 decimal digits
or risk a buffer overflow and a crash.

Restrict table identifiers in [0 ... 999999999] interval.

Reported-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c