All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Mohit Bhasi <mohitbhasi1998@gmail.com>,
	"V. Saicharan" <vsaicharan1998@gmail.com>,
	Leslie Monis <lesliemonis@gmail.com>,
	"Sachin D. Patil" <sdp.sachin@gmail.com>,
	Gautam Ramakrishnan <gautamramk@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2 net] net: sched: prevent a use after free
Date: Wed, 5 Feb 2020 10:03:45 -0800	[thread overview]
Message-ID: <CAM_iQpWKQ+59GfAP8RTntEM55FC7AYvZgo_hhPXNMbxCpo-c=g@mail.gmail.com> (raw)
In-Reply-To: <20200205115330.7x2qgaks7racy5wj@kili.mountain>

On Wed, Feb 5, 2020 at 3:56 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The bug is that we call kfree_skb(skb) and then pass "skb" to
> qdisc_pkt_len(skb) on the next line, which is a use after free.
> Also Cong Wang points out that it's better to delay the actual
> frees until we drop the rtnl lock so we should use rtnl_kfree_skbs()
> instead of kfree_skb().
>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Mohit Bhasi <mohitbhasi1998@gmail.com>,
	"V. Saicharan" <vsaicharan1998@gmail.com>,
	Leslie Monis <lesliemonis@gmail.com>,
	"Sachin D. Patil" <sdp.sachin@gmail.com>,
	Gautam Ramakrishnan <gautamramk@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2 net] net: sched: prevent a use after free
Date: Wed, 05 Feb 2020 18:03:45 +0000	[thread overview]
Message-ID: <CAM_iQpWKQ+59GfAP8RTntEM55FC7AYvZgo_hhPXNMbxCpo-c=g@mail.gmail.com> (raw)
In-Reply-To: <20200205115330.7x2qgaks7racy5wj@kili.mountain>

On Wed, Feb 5, 2020 at 3:56 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The bug is that we call kfree_skb(skb) and then pass "skb" to
> qdisc_pkt_len(skb) on the next line, which is a use after free.
> Also Cong Wang points out that it's better to delay the actual
> frees until we drop the rtnl lock so we should use rtnl_kfree_skbs()
> instead of kfree_skb().
>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks!

  reply	other threads:[~2020-02-05 18:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31  6:56 [PATCH net] net: sched: prevent a use after free Dan Carpenter
2020-01-31  6:56 ` Dan Carpenter
2020-02-01 19:38 ` Cong Wang
2020-02-01 19:38   ` Cong Wang
2020-02-03  8:38   ` Dan Carpenter
2020-02-03  8:38     ` Dan Carpenter
2020-02-03 19:58     ` Cong Wang
2020-02-03 19:58       ` Cong Wang
2020-02-03 20:33       ` Cong Wang
2020-02-03 20:33         ` Cong Wang
2020-02-05 11:53         ` [PATCH v2 " Dan Carpenter
2020-02-05 11:53           ` Dan Carpenter
2020-02-05 18:03           ` Cong Wang [this message]
2020-02-05 18:03             ` Cong Wang
2020-02-06 13:01           ` David Miller
2020-02-06 13:01             ` 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='CAM_iQpWKQ+59GfAP8RTntEM55FC7AYvZgo_hhPXNMbxCpo-c=g@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=gautamramk@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=lesliemonis@gmail.com \
    --cc=mohitbhasi1998@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdp.sachin@gmail.com \
    --cc=vsaicharan1998@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 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.