[PATCH] ipvs: freeing uninitialized pointer on error

To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Subject: [PATCH] ipvs: freeing uninitialized pointer on error
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Hans Schillstrom <hans.schillstrom@xxxxxxxxxxxx>, Hans Schillstrom <hans@xxxxxxxxxxxxxxx>, Jesper Dangaard Brouer <brouer@xxxxxxxxxx>, Dan Carpenter <dan.carpenter@xxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 28 Jan 2013 10:18:34 +0900
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

If state != IP_VS_STATE_BACKUP then tinfo->buf is uninitialized.  If
kthread_run() fails then it means we free random memory resulting in an

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Acked-by: Julian Anastasov <ja@xxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
 net/netfilter/ipvs/ip_vs_sync.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index effa10c..44fd10c 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1795,6 +1795,8 @@ int start_sync_thread(struct net *net, int state, char 
*mcast_ifn, __u8 syncid)
                        if (!tinfo->buf)
                                goto outtinfo;
+               } else {
+                       tinfo->buf = NULL;
                tinfo->id = id;

To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>
  • [GIT PULL nf] IPVS, Simon Horman
    • [PATCH] ipvs: freeing uninitialized pointer on error, Simon Horman <=