Selaa lähdekoodia

[NETFILTER]: ipt_CLUSTERIP: fix oops in checkentry function

The clusterip_config_find_get() already increases entries reference
counter, so there is no reason to do it twice in checkentry() callback.

This causes the config to be freed before it is removed from the list,
resulting in a crash when adding the next rule.

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jaroslav Kysela 19 vuotta sitten
vanhempi
commit
50c9cc2e54
1 muutettua tiedostoa jossa 0 lisäystä ja 2 poistoa
  1. 0 2
      net/ipv4/netfilter/ipt_CLUSTERIP.c

+ 0 - 2
net/ipv4/netfilter/ipt_CLUSTERIP.c

@@ -411,12 +411,10 @@ checkentry(const char *tablename,
 				       "has invalid config pointer!\n");
 				       "has invalid config pointer!\n");
 				return 0;
 				return 0;
 			}
 			}
-			clusterip_config_entry_get(cipinfo->config);
 		} else {
 		} else {
 			/* Case B: This is a new rule referring to an existing
 			/* Case B: This is a new rule referring to an existing
 			 * clusterip config. */
 			 * clusterip config. */
 			cipinfo->config = config;
 			cipinfo->config = config;
-			clusterip_config_entry_get(cipinfo->config);
 		}
 		}
 	} else {
 	} else {
 		/* Case C: This is a completely new clusterip config */
 		/* Case C: This is a completely new clusterip config */