Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Eric Dumazet <edumazet@google.com>
Cc: linux-can@vger.kernel.org, Ziyang Xuan <william.xuanziyang@huawei.com>
Subject: Re: [RFC PATCH] can: raw: add missing refcount for memory leak fix
Date: Tue, 15 Aug 2023 19:21:02 +0200	[thread overview]
Message-ID: <c509c99f-0a05-da44-df69-4c1fe39bd40d@hartkopp.net> (raw)
In-Reply-To: <CANn89iLWfZyDb2CMUjaKn7GW9nQE4M85=sWN_6Lk=pqNH+g=+Q@mail.gmail.com>

Hello Eric,

On 04.08.23 17:59, Eric Dumazet wrote:

>>> Hi Olivier
>>>
>>> I would feel a bit safer with new longterm device references if you
>>> could add an ro->dev_tracker and use netdev_put() netdev_hold() and
>>> friends ;)
>>>
>>> Thanks !
>>>
>>
>> Hi Eric,
>>
>> the netdev_hold() mechanic has been introduced in Linux 6.0.
>>
>> Would it make sense to take this patch as fix for all the current stable
>> kernels and move to the dev-tracker as improvement via net-next as usual?
> 
> Good question.
> 
> My take on this, but others might disagree :
> 
> I think it is better to cook a patch for current upstream kernels.
> 
> Then we will adapt it when backporting to old ones, it should be
> relatively easy.

I implemented both versions with dev tracker and without dev tracker.

It was just the renaming of (net)dev_[hold|put] and having the 
dev_tracker element in the raw_sock data structure.

The new patch is here:
https://lore.kernel.org/linux-can/20230815171447.10879-1-socketcan@hartkopp.net/T/#u

I would appreciate if you could take a short look at it.

Many thanks,
Oliver


      reply	other threads:[~2023-08-15 17:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 11:28 [RFC PATCH] can: raw: add missing refcount for memory leak fix Oliver Hartkopp
2023-08-04 12:12 ` Eric Dumazet
2023-08-04 15:46   ` Oliver Hartkopp
2023-08-04 15:59     ` Eric Dumazet
2023-08-15 17:21       ` Oliver Hartkopp [this message]

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=c509c99f-0a05-da44-df69-4c1fe39bd40d@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=edumazet@google.com \
    --cc=linux-can@vger.kernel.org \
    --cc=william.xuanziyang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).