From: yajun.deng@linux.dev
To: "Eric Dumazet" <edumazet@google.com>
Cc: "David Miller" <davem@davemloft.net>,
"Hideaki YOSHIFUJI" <yoshfuji@linux-ipv6.org>,
"David Ahern" <dsahern@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"netdev" <netdev@vger.kernel.org>,
"LKML" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"
Date: Tue, 14 Sep 2021 02:21:19 +0000 [thread overview]
Message-ID: <2a95994f251db7d1c5d3318f4468b324@linux.dev> (raw)
In-Reply-To: <CANn89iKsbdMV1JmjzzGNu-2janfudb-t-Le-JempLrroJcNH-Q@mail.gmail.com>
September 14, 2021 12:15 AM, "Eric Dumazet" <edumazet@google.com> wrote:
> On Sun, Sep 12, 2021 at 9:04 PM Yajun Deng <yajun.deng@linux.dev> wrote:
>
>> This reverts commit 919483096bfe75dda338e98d56da91a263746a0a.
>>
>> There is only when ip_options_get() return zero need to free.
>> It already called kfree() when return error.
>>
>> Fixes: 919483096bfe ("ipv4: fix memory leaks in ip_cmsg_send() callers")
>> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
>> ---
>
> I do not think this is a valid patch, not sure why David has merged so
> soon before us reviewing it ?
>
> You are bringing back the memory leaks.
>
> ip_cmsg_send() can loop over multiple cmsghdr()
>
Yes, I forgot the loop, it was my mistake.
> If IP_RETOPTS has been successful, but following cmsghdr generates an error,
> we do not free ipc.ok
>
> If IP_RETOPTS is not successful, we have freed the allocated temporary space,
> not the one currently in ipc.opt.
>
> Can you share what your exact finding was, perhaps a syzbot repro ???
>
> Thanks.
prev parent reply other threads:[~2021-09-14 2:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 4:04 [PATCH] Revert "ipv4: fix memory leaks in ip_cmsg_send() callers" Yajun Deng
2021-09-13 11:40 ` patchwork-bot+netdevbpf
2021-09-13 16:15 ` Eric Dumazet
2021-09-14 2:21 ` yajun.deng [this message]
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=2a95994f251db7d1c5d3318f4468b324@linux.dev \
--to=yajun.deng@linux.dev \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox