[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMArcTUmb8biZUDxf_7BpYKVW-MyQuZK4mk0D0fBhFp_E143Xg@mail.gmail.com>
Date: Tue, 21 Jul 2020 13:15:26 +0900
From: Taehee Yoo <ap420073@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>, jiri@...lanox.com
Subject: Re: [PATCH net] netdevsim: fix unbalaced locking in nsim_create()
On Tue, 21 Jul 2020 at 02:57, Jakub Kicinski <kuba@...nel.org> wrote:
>
Hi Jakub,
Thank you for your review!
> On Sat, 18 Jul 2020 06:49:21 +0000 Taehee Yoo wrote:
> > In the nsim_create(), rtnl_lock() is called before nsim_bpf_init().
> > If nsim_bpf_init() is failed, rtnl_unlock() should be called,
> > but it isn't called.
> > So, unbalanced locking would occur.
> >
> > Fixes: e05b2d141fef ("netdevsim: move netdev creation/destruction to dev probe")
> > Signed-off-by: Taehee Yoo <ap420073@...il.com>
> > ---
> > drivers/net/netdevsim/netdev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
> > index 2908e0a0d6e1..b2a67a88b6ee 100644
> > --- a/drivers/net/netdevsim/netdev.c
> > +++ b/drivers/net/netdevsim/netdev.c
> > @@ -316,8 +316,8 @@ nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port)
> > err_ipsec_teardown:
> > nsim_ipsec_teardown(ns);
> > nsim_bpf_uninit(ns);
> > - rtnl_unlock();
> > err_free_netdev:
>
> Could you rename this label err_unlock, since it's not pointing to
> free_netdev any more?
>
I will send a v2 patch to change the label name.
Thanks a lot!
Taehee Yoo
Powered by blists - more mailing lists