From: Phil Sutter <phil@nwl.cc>
To: dsahern@kernel.org
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
David Ahern <dsahern@gmail.com>,
Hangbin Liu <liuhangbin@gmail.com>
Subject: Re: [PATCH iproute2] iplink_vrf: Save device index from response for return code
Date: Fri, 1 Jun 2018 19:05:49 +0200 [thread overview]
Message-ID: <20180601170549.GO16785@orbyte.nwl.cc> (raw)
In-Reply-To: <20180601155016.3524-1-dsahern@kernel.org>
On Fri, Jun 01, 2018 at 08:50:16AM -0700, dsahern@kernel.org wrote:
> From: David Ahern <dsahern@gmail.com>
>
> A recent commit changed rtnl_talk_* to return the response message in
> allocated memory so callers need to free it. The change to name_is_vrf
> did not save the device index which is pointing to a struct inside the
> now allocated and freed memory resulting in garbage getting returned
> in some cases.
>
> Fix by using a stack variable to save the return value and only set
> it to ifi->ifi_index after all checks are done and before the answer
> buffer is freed.
>
> Fixes: 86bf43c7c2fdc ("lib/libnetlink: update rtnl_talk to support malloc buff at run time")
> Cc: Hangbin Liu <liuhangbin@gmail.com>
> Cc: Phil Sutter <phil@nwl.cc>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Thanks, Phil
next prev parent reply other threads:[~2018-06-01 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 15:50 [PATCH iproute2] iplink_vrf: Save device index from response for return code dsahern
2018-06-01 17:05 ` Phil Sutter [this message]
2018-06-04 1:11 ` Hangbin Liu
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=20180601170549.GO16785@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).