On 2/22/23 15:24, Simon Horman wrote:
> On Wed, Feb 22, 2023 at 01:56:51PM +0100, Ales Musil wrote:
>> Nothing is being freed wherever we are calling
>> ctl_fatal which is fine because the program is
>> about to shutdown anyway however one of the
>> leaks was caught by address sanitizer.
>> Fix most of the leaks that are happening before
>> call to ctl_fatal.
>>
>> Direct leak of 64 byte(s) in 1 object(s) allocated from:
>>     #0 0x568d70 in __interceptor_realloc.part.0 asan_malloc_linux.cpp.o
>>     #1 0xa530a5 in xrealloc__ /workspace/ovn/ovs/lib/util.c:147:9
>>     #2 0xa530a5 in xrealloc /workspace/ovn/ovs/lib/util.c:179:12
>>     #3 0xa530a5 in x2nrealloc /workspace/ovn/ovs/lib/util.c:239:12
>>     #4 0xa2ee57 in svec_expand /workspace/ovn/ovs/lib/svec.c:92:23
>>     #5 0xa2ef6e in svec_terminate /workspace/ovn/ovs/lib/svec.c:116:5
>>     #6 0x82c117 in ovs_cmdl_env_parse_all 
>> /workspace/ovn/ovs/lib/command-line.c:98:5
>>     #7 0x5ad70d in ovn_dbctl_main /workspace/ovn/utilities/ovn-dbctl.c:132:20
>>     #8 0x5b58c7 in main /workspace/ovn/utilities/ovn-nbctl.c:7943:12
>>
>> Indirect leak of 10 byte(s) in 1 object(s) allocated from:
>>     #0 0x569c07 in malloc (/workspace/ovn/utilities/ovn-nbctl+0x569c07) 
>> (BuildId: 3a287416f70de43f52382f0336980c876f655f90)
>>     #1 0xa52d4c in xmalloc__ /workspace/ovn/ovs/lib/util.c:137:15
>>     #2 0xa52d4c in xmalloc /workspace/ovn/ovs/lib/util.c:172:12
>>     #3 0xa52d4c in xmemdup0 /workspace/ovn/ovs/lib/util.c:193:15
>>     #4 0xa2e580 in svec_add /workspace/ovn/ovs/lib/svec.c:71:27
>>     #5 0x82c041 in ovs_cmdl_env_parse_all 
>> /workspace/ovn/ovs/lib/command-line.c:91:5
>>     #6 0x5ad70d in ovn_dbctl_main /workspace/ovn/utilities/ovn-dbctl.c:132:20
>>     #7 0x5b58c7 in main /workspace/ovn/utilities/ovn-nbctl.c:7943:12
>>
>> Indirect leak of 8 byte(s) in 2 object(s) allocated from:
>>     #0 0x569c07 in malloc (/workspace/ovn/utilities/ovn-nbctl+0x569c07)
>>     #1 0xa52d4c in xmalloc__ /workspace/ovn/ovs/lib/util.c:137:15
>>     #2 0xa52d4c in xmalloc /workspace/ovn/ovs/lib/util.c:172:12
>>     #3 0xa52d4c in xmemdup0 /workspace/ovn/ovs/lib/util.c:193:15
>>     #4 0xa2e580 in svec_add /workspace/ovn/ovs/lib/svec.c:71:27
>>     #5 0x82c0b6 in ovs_cmdl_env_parse_all 
>> /workspace/ovn/ovs/lib/command-line.c:96:9
>>     #6 0x5ad70d in ovn_dbctl_main /workspace/ovn/utilities/ovn-dbctl.c:132:20
>>     #7 0x5b58c7 in main /workspace/ovn/utilities/ovn-nbctl.c:7943:12
>>
>> Signed-off-by: Ales Musil <amu...@redhat.com>
>> ---
>> v2: Address comments from Simon:
>>     - Rearrange the cleanup according to suggestion.
>>     - Allow free(NULL).
> 
> Minor nit not withstanding, this looks good to me.
> 
> Reviewed-by: Simon Horman <simon.hor...@corigine.com>
> 

I took care of the nit and applied the patch to main and backported to
all stable branches down to 22.03.

Thanks for the fix, Ales and for reviews, Simon!

Regards,
Dumitru

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to