Netdev List
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	davem@davemloft.net, Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: [PATCHv3 net] net: sched: set xt_tgchk_param par.net properly in ipt_init_target
Date: Tue, 8 Aug 2017 10:24:03 +0200	[thread overview]
Message-ID: <20170808082403.GD1853@nanopsycho> (raw)
In-Reply-To: <7aa6e3f47ea0feb6f348b4de20fc6503e8c8e25b.1502177125.git.lucien.xin@gmail.com>

Tue, Aug 08, 2017 at 09:25:25AM CEST, lucien.xin@gmail.com wrote:
>Now xt_tgchk_param par in ipt_init_target is a local varibale,
>par.net is not initialized there. Later when xt_check_target
>calls target's checkentry in which it may access par.net, it
>would cause kernel panic.
>
>Jaroslav found this panic when running:
>
>  # ip link add TestIface type dummy
>  # tc qd add dev TestIface ingress handle ffff:
>  # tc filter add dev TestIface parent ffff: u32 match u32 0 0 \
>    action xt -j CONNMARK --set-mark 4
>
>This patch is to pass net param into ipt_init_target and set
>par.net with it properly in there.
>
>v1->v2:
>  As Wang Cong pointed, I missed ipt_net_id != xt_net_id, so fix
>  it by also passing net_id to __tcf_ipt_init.
>v2->v3:
>  Missed the fixes tag, so add it.
>
>Fixes: ecb2421b5ddf ("netfilter: add and use nf_ct_netns_get/put")
>Reported-by: Jaroslav Aster <jaster@redhat.com>
>Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

  reply	other threads:[~2017-08-08  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  7:25 [PATCHv3 net] net: sched: set xt_tgchk_param par.net properly in ipt_init_target Xin Long
2017-08-08  8:24 ` Jiri Pirko [this message]
2017-08-09  3:38 ` David Miller

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=20170808082403.GD1853@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --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