From: Aaron Conole <aconole@redhat.com>
To: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: netdev@vger.kernel.org, dev@openvswitch.org, pshelar@ovn.org,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, ptikhomirov@virtuozzo.com,
alexander.mikhalitsyn@virtuozzo.com, avagin@google.com,
brauner@kernel.org, mark.d.gray@redhat.com, i.maximets@ovn.org
Subject: Re: [PATCH net-next v2 2/3] openvswitch: fix memory leak at failed datapath creation
Date: Mon, 22 Aug 2022 08:53:44 -0400 [thread overview]
Message-ID: <f7tzgfwmobr.fsf@redhat.com> (raw)
In-Reply-To: <20220819153044.423233-3-andrey.zhadchenko@virtuozzo.com> (Andrey Zhadchenko's message of "Fri, 19 Aug 2022 18:30:43 +0300")
Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com> writes:
> ovs_dp_cmd_new()->ovs_dp_change()->ovs_dp_set_upcall_portids()
> allocates array via kmalloc.
> If for some reason new_vport() fails during ovs_dp_cmd_new()
> dp->upcall_portids must be freed.
> Add missing kfree.
>
> Kmemleak example:
> unreferenced object 0xffff88800c382500 (size 64):
> comm "dump_state", pid 323, jiffies 4294955418 (age 104.347s)
> hex dump (first 32 bytes):
> 5e c2 79 e4 1f 7a 38 c7 09 21 38 0c 80 88 ff ff ^.y..z8..!8.....
> 03 00 00 00 0a 00 00 00 14 00 00 00 28 00 00 00 ............(...
> backtrace:
> [<0000000071bebc9f>] ovs_dp_set_upcall_portids+0x38/0xa0
> [<000000000187d8bd>] ovs_dp_change+0x63/0xe0
> [<000000002397e446>] ovs_dp_cmd_new+0x1f0/0x380
> [<00000000aa06f36e>] genl_family_rcv_msg_doit+0xea/0x150
> [<000000008f583bc4>] genl_rcv_msg+0xdc/0x1e0
> [<00000000fa10e377>] netlink_rcv_skb+0x50/0x100
> [<000000004959cece>] genl_rcv+0x24/0x40
> [<000000004699ac7f>] netlink_unicast+0x23e/0x360
> [<00000000c153573e>] netlink_sendmsg+0x24e/0x4b0
> [<000000006f4aa380>] sock_sendmsg+0x62/0x70
> [<00000000d0068654>] ____sys_sendmsg+0x230/0x270
> [<0000000012dacf7d>] ___sys_sendmsg+0x88/0xd0
> [<0000000011776020>] __sys_sendmsg+0x59/0xa0
> [<000000002e8f2dc1>] do_syscall_64+0x3b/0x90
> [<000000003243e7cb>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
>
> Fixes: b83d23a2a38b ("openvswitch: Introduce per-cpu upcall dispatch")
> Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
> ---
Thanks for this patch. I guess independent of this series, this patch
should be applied to the net tree as well - it fixes an existing issue.
Acked-by: Aaron Conole <aconole@redhat.com>
I will try as well the other patches in the series.
next prev parent reply other threads:[~2022-08-22 12:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 15:30 [PATCH net-next v2 0/3] openvswitch: allow specifying ifindex of new interfaces Andrey Zhadchenko
2022-08-19 15:30 ` [PATCH net-next v2 1/3] " Andrey Zhadchenko
2022-08-22 8:06 ` Christian Brauner
2022-08-23 1:37 ` Jakub Kicinski
2022-08-23 13:50 ` Andrey Zhadchenko
2022-08-23 19:15 ` Jakub Kicinski
2022-08-19 15:30 ` [PATCH net-next v2 2/3] openvswitch: fix memory leak at failed datapath creation Andrey Zhadchenko
2022-08-22 12:53 ` Aaron Conole [this message]
2022-08-23 1:38 ` Jakub Kicinski
2022-08-19 15:30 ` [PATCH net-next v2 3/3] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests Andrey Zhadchenko
2022-08-23 1:41 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7tzgfwmobr.fsf@redhat.com \
--to=aconole@redhat.com \
--cc=alexander.mikhalitsyn@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=avagin@google.com \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=edumazet@google.com \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=mark.d.gray@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pshelar@ovn.org \
--cc=ptikhomirov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.