From: Dan Carpenter <dan.carpenter@linaro.org>
To: Dan Cross <crossd@gmail.com>
Cc: lars@oddbit.com, Duoming Zhou <duoming@zju.edu.cn>,
linux-hams@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v4] ax25: Fix refcount imbalance on inbound connections
Date: Thu, 23 May 2024 21:23:08 +0300 [thread overview]
Message-ID: <61368681-64b5-43f7-9a6d-5e56b188a826@moroto.mountain> (raw)
In-Reply-To: <CAEoi9W45jE_K6yDYdndYOTm375+r70gHuh3rWEtB729rUxNUWA@mail.gmail.com>
On Thu, May 23, 2024 at 11:22:43AM -0400, Dan Cross wrote:
> On Thu, May 23, 2024 at 11:05 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> > > [snip]
> >
> > I've already said that I don't think the patch is correct and offered
> > an alternative which takes a reference in accept() but also adds a
> > matching put()... But I can't really test my patch so if we're going to
> > do something that we know is wrong, I'd prefer to just revert Duoming's
> > patch.
>
> Dan, may I ask how you determined that Lars's patch is incorrect?
The problem is that accept() and ax25_release() are not mirrored pairs.
We're just taking the reference and never dropping it. Which fixes the
use after free but introduces a leak.
> Testing so far indicates that it works as expected. On the other hand,
> Lars tested your patch and found that it did not address the
> underlying issue
> (https://marc.info/?l=linux-hams&m=171646940902757&w=2).
Yeah. I've said a couple times that my patch wasn't complete. I keep
hoping that Duoming will chime in here...
>
> If I may suggest a path forward, given that observed results show that
> Lars's patch works as expected, perhaps we can commit that and then
> work to incorporate a more robust ref counting strategy a la your
> patch?
The argument for this patch is that it works in testing even though we
think it's not totally correct. That's not really a good argument.
Like we can revert patches that clearly don't work so we could revert
Duoming's patch, but when we're adding code then that should work.
regards,
dan carpenter
next prev parent reply other threads:[~2024-05-23 18:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 18:31 [PATCH v4] ax25: Fix refcount imbalance on inbound connections lars
2024-05-23 15:05 ` Dan Carpenter
2024-05-23 15:22 ` Dan Cross
2024-05-23 18:23 ` Dan Carpenter [this message]
2024-05-23 20:39 ` Dan Cross
2024-05-24 15:25 ` Lars Kellogg-Stedman
2024-05-24 15:47 ` Dan Cross
2024-05-27 6:54 ` Dan Carpenter
2024-05-28 9:40 ` Paolo Abeni
2024-05-28 16:06 ` Lars Kellogg-Stedman
2024-05-29 14:34 ` Dan Carpenter
2024-05-29 14:54 ` Lars Kellogg-Stedman
2024-05-29 15:20 ` Dan Carpenter
2024-05-29 15:01 ` duoming
2024-05-29 15:22 ` Dan Carpenter
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=61368681-64b5-43f7-9a6d-5e56b188a826@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=crossd@gmail.com \
--cc=duoming@zju.edu.cn \
--cc=lars@oddbit.com \
--cc=linux-hams@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox