[ovs-git] [openvswitch/ovs] e73cd6: odp-util: Fix use of uninitialized erspan metadata.

Ilya Maximets noreply at github.com
Tue Apr 20 10:05:55 UTC 2021

  Branch: refs/heads/branch-2.12
  Home:   https://github.com/openvswitch/ovs
  Commit: e73cd64103bf068c56a191dfc4eb624960b33fd6
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M lib/odp-util.c

  Log Message:
  odp-util: Fix use of uninitialized erspan metadata.

'struct erspan_metadata' contains union with fields of different
sizes, hence not all the memory initiliazed.  This memory goes
to syscalls and also used to compare ukeys with memcmp which may
cause unexpected behavior.

 Thread 15 revalidator13:
 Conditional jump or move depends on uninitialised value(s)
    at 0x4C377B6: bcmp (vg_replace_strmem.c:1111)
    by 0x43F844: ofpbuf_equal (ofpbuf.h:273)
    by 0x43F844: revalidate_ukey__ (ofproto-dpif-upcall.c:2227)
    by 0x43F9C9: revalidate_ukey (ofproto-dpif-upcall.c:2294)
    by 0x4425C2: revalidate.isra.33 (ofproto-dpif-upcall.c:2734)
    by 0x4434B8: udpif_revalidator (ofproto-dpif-upcall.c:943)
    by 0x4FDE2C: ovsthread_wrapper (ovs-thread.c:383)
    by 0x5E19159: start_thread (in /usr/lib64/libpthread-2.28.so)
    by 0x69ECF72: clone (in /usr/lib64/libc-2.28.so)
  Uninitialised value was created by a stack allocation
    at 0x4B1CE0: tun_key_to_attr (odp-util.c:3129)

Fixes: 98514eea21f4 ("erspan: add kernel datapath support")
Acked-by: William Tu <u9012063 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>

More information about the git mailing list