Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ofp-actions: Fix use of uninitialized padding in set-field.
Commit 933aaf9 re-aligned the fields, so the access to them is aligned, but it also didn't initialize the added padding. 'ofpacts' are frequently compared with memcmp() and being hashed as part of the frozen state causing false negative comparisons and potentially frozen state lookup failures. Found by running make check-valgrind on 'continuation - data stack' tests: Conditional jump or move depends on uninitialised value(s) at 0x4EBC82: mhash_add__ (hash.h:66) by 0x4EBC48: mhash_add (hash.h:78) by 0x4EB4F8: hash_add (hash.h:109) by 0x4EBDEC: hash_add64 (hash.h:114) by 0x4EBDAC: hash_add_words64 (hash.h:439) by 0x4EB6D2: hash_words64_inline (hash.h:136) by 0x4EB6A2: hash_words64__ (hash.c:73) by 0x4595F2: hash_words64 (hash.h:371) by 0x4593C6: hash_bytes64 (hash.h:399) by 0x458B76: frozen_state_hash (ofproto-dpif-rid.c:143) by 0x458CA4: recirc_alloc_id_ctx (ofproto-dpif-rid.c:280) by 0x483B85: finish_freezing__ (ofproto-dpif-xlate.c:5229) by 0x47171F: finish_freezing (ofproto-dpif-xlate.c:5271) by 0x46E8BB: xlate_actions (ofproto-dpif-xlate.c:8340) by 0x45DC7B: ofproto_trace__ (ofproto-dpif-trace.c:782) by 0x45D816: ofproto_trace (ofproto-dpif-trace.c:851) by 0x45E435: ofproto_unixctl_trace (ofproto-dpif-trace.c:490) by 0x609F5E: process_command (unixctl.c:310) by 0x6094B9: run_connection (unixctl.c:344) by 0x609397: unixctl_server_run (unixctl.c:395) Uninitialised value was created by a stack allocation at 0x432A44: handle_flow_mod (ofproto.c:6346) Fix that by properly initializing the whole space allocated for the set-field action. Fixes: 933aaf9 ("ofp-actions: Ensure aligned accesses to masked fields.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
- Loading branch information