lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89i+su4aEk8HYZwEWyub80WMAq61hYrOzvfHV6OpQVhu7Gw@mail.gmail.com>
Date:   Sun, 6 Feb 2022 06:25:22 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH net] net/smc: fix ref_tracker issue in smc_pnet_add()

On Sat, Feb 5, 2022 at 9:05 PM Eric Dumazet <eric.dumazet@...il.com> wrote:
>

>
> diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
> index 291f1484a1b74c0a793ab3c4f3ef90804d1f9932..fb6331d97185a5db9b4539e7f081e9fa469bc44b 100644
> --- a/net/smc/smc_pnet.c
> +++ b/net/smc/smc_pnet.c
> @@ -368,9 +368,6 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
>         new_pe->type = SMC_PNET_ETH;
>         memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN);
>         strncpy(new_pe->eth_name, eth_name, IFNAMSIZ);
> -       new_pe->ndev = ndev;
> -       if (ndev)
> -               netdev_tracker_alloc(ndev, &new_pe->dev_tracker, GFP_KERNEL);
>         rc = -EEXIST;
>         new_netdev = true;
>         write_lock(&pnettable->lock);
> @@ -382,6 +379,11 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
>                 }
>         }
>         if (new_netdev) {
> +               if (ndev) {
> +                       new_pe->ndev = ndev;
> +                       netdev_tracker_alloc(ndev, &new_pe->dev_tracker,
> +                                            GFP_KERNEL);

Oh well, this needs to become GFP_ATOMIC, we are under a write_lock() section.

I will send a fix :/

> +               }
>                 list_add_tail(&new_pe->list, &pnettable->pnetlist);
>                 write_unlock(&pnettable->lock);
>         } else {
> --
> 2.35.0.263.gb82422642f-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ