From: David Miller <davem@davemloft.net>
To: vladbu@mellanox.com
Cc: netdev@vger.kernel.org, dcaratti@redhat.com, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us, wenxu@ucloud.cn,
roid@mellanox.com
Subject: Re: [PATCH net-next v2] net: sched: act_tunnel_key: fix metadata handling
Date: Wed, 27 Feb 2019 21:36:25 -0800 (PST) [thread overview]
Message-ID: <20190227.213625.273284316654251760.davem@davemloft.net> (raw)
In-Reply-To: <20190225153014.8885-1-vladbu@mellanox.com>
From: Vlad Buslov <vladbu@mellanox.com>
Date: Mon, 25 Feb 2019 17:30:14 +0200
> Tunnel key action params->tcft_enc_metadata is only set when action is
> TCA_TUNNEL_KEY_ACT_SET. However, metadata pointer is incorrectly
> dereferenced during tunnel key init and release without verifying that
> action is if correct type, which causes NULL pointer dereference. Metadata
> tunnel dst_cache is also leaked on action overwrite.
>
> Fix metadata handling:
> - Verify that metadata pointer is not NULL before dereferencing it in
> tunnel_key_init error handling code.
> - Move dst_cache destroy code into tunnel_key_release_params() function
> that is called in both action overwrite and release cases (fixes resource
> leak) and verifies that actions has correct type before dereferencing
> metadata pointer (fixes NULL pointer dereference).
>
> Oops with KASAN enabled during tdc tests execution:
...
> Fixes: 41411e2fd6b8 ("net/sched: act_tunnel_key: Add dst_cache support")
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
> ---
> Changes from V1 to V2:
> - Extract metadata->dst error handler fix into standalone patch that targets
> net.
Applied, thanks Vlad.
prev parent reply other threads:[~2019-02-28 5:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 12:21 [PATCH net-next] net: sched: act_tunnel_key: fix metadata handling Vlad Buslov
2019-02-25 14:04 ` Davide Caratti
2019-02-25 15:12 ` Vlad Buslov
2019-02-25 15:28 ` [PATCH net] net: sched: act_tunnel_key: fix NULL pointer dereference during init Vlad Buslov
2019-02-25 15:36 ` Davide Caratti
2019-02-25 18:16 ` David Miller
2019-02-25 15:30 ` [PATCH net-next v2] net: sched: act_tunnel_key: fix metadata handling Vlad Buslov
2019-02-27 8:14 ` Roi Dayan
2019-02-28 5:36 ` David Miller [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=20190227.213625.273284316654251760.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=roid@mellanox.com \
--cc=vladbu@mellanox.com \
--cc=wenxu@ucloud.cn \
--cc=xiyou.wangcong@gmail.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 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).