]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipmr/ip6mr: fix potential out-of-bounds vif_table access
authorPatrick McHardy <kaber@trash.net>
Wed, 17 Mar 2010 06:04:14 +0000 (06:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 20 Mar 2010 05:47:22 +0000 (22:47 -0700)
commit6c42270a92cd04566b2234939ee1cfbe4a0a87c3
tree522ac0b3ac330fb53d4ee9147f7565b27b482085
parent3e274d3283dd93cba1cb920765f30c212c57cf43
net: ipmr/ip6mr: fix potential out-of-bounds vif_table access

mfc_parent of cache entries is used to index into the vif_table and is
initialised from mfcctl->mfcc_parent. This can take values of to 2^16-1,
while the vif_table has only MAXVIFS (32) entries. The same problem
affects ip6mr.

Refuse invalid values to fix a potential out-of-bounds access. Unlike
the other validity checks, this is checked in ipmr_mfc_add() instead of
the setsockopt handler since its unused in the delete path and might be
uninitialized.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c
net/ipv6/ip6mr.c