conntrack: Fix conn_update_state_alg use after free.
When conn_update_state() returns true, conn has been freed, so skip calling
handle_ftp_ctl() with this conn and instead follow code path for new
connections.
Fixes: ("Userspace Datapath: Add ALG infra and FTP.")
@@ -1156,9 +1156,12 @@ conn_update_state_alg(struct conntrack *ct, struct dp_packet *pkt,
} else {
*create_new_conn = conn_update_state(ct, pkt, ctx, &conn, now,
bucket);
+
+ if (*create_new_conn == false) {
handle_ftp_ctl(ct, ctx, pkt, conn, now, CT_FTP_CTL_OTHER,
!!nat_action_info);
}
+ }
return true;
}
return false;
