All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	syzbot <syzkaller@googlegroups.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [PATCH net] sch_netem: fix issues in netem_change() vs get_dist_table()
Date: Fri, 23 Jun 2023 09:54:42 +0200	[thread overview]
Message-ID: <ZJVPwoC09KWQeJpu@corigine.com> (raw)
In-Reply-To: <20230622181503.2327695-1-edumazet@google.com>

On Thu, Jun 22, 2023 at 06:15:03PM +0000, Eric Dumazet wrote:
> In blamed commit, I missed that get_dist_table() was allocating
> memory using GFP_KERNEL, and acquiring qdisc lock to perform
> the swap of newly allocated table with current one.
> 
> In this patch, get_dist_table() is allocating memory and
> copy user data before we acquire the qdisc lock.
> 
> Then we perform swap operations while being protected by the lock.
> 
> Note that after this patch netem_change() no longer can do partial changes.
> If an error is returned, qdisc conf is left unchanged.
> 
> Fixes: 2174a08db80d ("sch_netem: acquire qdisc lock in netem_change()")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: Simon Horman <simon.horman@corigine.com>
> ---
>  net/sched/sch_netem.c | 59 ++++++++++++++++++-------------------------
>  1 file changed, 25 insertions(+), 34 deletions(-)

Reviewed-by: Simon Horman <simon.horman@corigine.com>


  parent reply	other threads:[~2023-06-23  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 18:15 [PATCH net] sch_netem: fix issues in netem_change() vs get_dist_table() Eric Dumazet
2023-06-22 18:56 ` Jamal Hadi Salim
2023-06-23  7:54 ` Simon Horman [this message]
2023-06-24 22:20 ` patchwork-bot+netdevbpf

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=ZJVPwoC09KWQeJpu@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=syzkaller@googlegroups.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.