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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iK5TYT=EiS7hMCVtOLk4P5F9wZCQYCkR+cTWUV7J4Ho_w@mail.gmail.com>
Date:   Thu, 2 Dec 2021 08:05:43 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Dmitry Vyukov <dvyukov@...gle.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 01/19] lib: add reference counting tracking infrastructure

On Thu, Dec 2, 2021 at 12:13 AM Dmitry Vyukov <dvyukov@...gle.com> wrote:
>
> On Thu, 2 Dec 2021 at 04:21, Eric Dumazet <eric.dumazet@...il.com> wrote:
> >
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > It can be hard to track where references are taken and released.
> >
> > In networking, we have annoying issues at device or netns dismantles,
> > and we had various proposals to ease root causing them.
> >
> > This patch adds new infrastructure pairing refcount increases
> > and decreases. This will self document code, because programmers
> > will have to associate increments/decrements.
> >
> > This is controled by CONFIG_REF_TRACKER which can be selected
> > by users of this feature.
> >
> > This adds both cpu and memory costs, and thus should probably be
> > used with care.
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>
>
> Reviewed-by: Dmitry Vyukov <dvyukov@...gle.com>
>

Thanks !

> > +
> > +       if (!tracker) {
> > +               refcount_dec(&dir->untracked);
>
> Nice approach.

Yes, I found that a boolean was weak, we can do a full refcounted way,

Transition from 1 to 0 will generate a warning/stacktrace

>
> > +               return -EEXIST;
> > +       }
> > +       nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 1);
> > +       nr_entries = filter_irq_stacks(entries, nr_entries);
>
> Marco sent a patch to do this as part of stack_depot_save() as we spoke:
> https://lore.kernel.org/lkml/20211130095727.2378739-1-elver@google.com/
> I am not sure in what order these patches will reach trees, but
> ultimately filter_irq_stacks() won't be needed here anymore...
>

Great, I will keep this in mind, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ