Skip to content

Commit

Permalink
conntrack: Fix using alg_exp_entry out of scope.
Browse files Browse the repository at this point in the history
'alg_exp_entry' is allocated on stack memory, but could be used via
'alg_exp' pointer inside 'write_ct_md' function, i.e. outside its scope.

CC: Darrell Ball <[email protected]>
Fixes: bd5e81a ("Userspace Datapath: Add ALG infra and FTP.")
Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya authored and blp committed Jul 10, 2018
1 parent 93c0ef1 commit 96bbcbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,9 +1246,9 @@ process_one(struct conntrack *ct, struct dp_packet *pkt,
}

const struct alg_exp_node *alg_exp = NULL;
struct alg_exp_node alg_exp_entry;

if (OVS_UNLIKELY(create_new_conn)) {
struct alg_exp_node alg_exp_entry;

ct_rwlock_rdlock(&ct->resources_lock);
alg_exp = expectation_lookup(&ct->alg_expectations, &ctx->key,
Expand Down

0 comments on commit 96bbcbf

Please sign in to comment.