[ovs-dev] [PATCH] ofproto-dpif: Fix using uninitialized execute hash.
i.maximets at ovn.org
Sat Jan 4 13:15:43 UTC 2020
On 04.01.2020 04:21, Tonghao Zhang wrote:
> On Sat, Jan 4, 2020 at 7:50 AM Ilya Maximets <i.maximets at ovn.org> wrote:
>> Most of callers doesn't initialize dpif_execute.hash leaving random
>> value from the stack. And this random value used later while encoding
>> netlink message and might produce unwanted kernel behavior.
>> Fix that by fully initializing dpif_execute structure. Using
>> designated initializers to avoid such issues in the future.
>> Fixes: 0442bfb11d6c ("ofproto-dpif-upcall: Echo HASH attribute back to datapath.")
> Hi, this patch is a bugfix for commit id 0442bfb11d6c? I think it
> improves the codes.
It is a bug fix. Code improvement is a side effect.
The purpose of this patch is to initialize execute.hash with zero.
This will be done by compiler if we will use designated initializers.
Best regards, Ilya Maximets.
More information about the dev