]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ipmr.c
net: ipmr/ip6mr: fix potential out-of-bounds vif_table access
[net-next-2.6.git] / net / ipv4 / ipmr.c
index 8582e12e4a62a8b11ec53d129aabbf16842fcc8e..0b9d03c54dc3a4f9930f122bd7e173e103709972 100644 (file)
@@ -802,6 +802,9 @@ static int ipmr_mfc_add(struct net *net, struct mfcctl *mfc, int mrtsock)
        int line;
        struct mfc_cache *uc, *c, **cp;
 
+       if (mfc->mfcc_parent >= MAXVIFS)
+               return -ENFILE;
+
        line = MFC_HASH(mfc->mfcc_mcastgrp.s_addr, mfc->mfcc_origin.s_addr);
 
        for (cp = &net->ipv4.mfc_cache_array[line];