netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
	andrew+netdev@lunn.ch, horms@kernel.org, almasrymina@google.com,
	sdf@fomichev.me, netdev@vger.kernel.org, asml.silence@gmail.com,
	dw@davidwei.uk, skhawaja@google.com, willemb@google.com,
	jdamato@fastly.com
Subject: Re: [PATCH net v2] net: devmem: fix kernel panic when socket close after module unload
Date: Wed, 7 May 2025 06:23:21 -0700	[thread overview]
Message-ID: <20250507062321.4acdf9e6@kernel.org> (raw)
In-Reply-To: <CAMArcTUx5cK2kh2M8BirtQRG5Qt+ArwZ_a=xwi_bTHyKJ7E+og@mail.gmail.com>

On Wed, 7 May 2025 13:55:44 +0900 Taehee Yoo wrote:
> So, it acquires a socket lock only for setting binding->dev to NULL,
> right? 

Yes.

BTW one more tiny nit pick:

 		net_devmem_unbind_dmabuf(binding);
+		mutex_unlock(&priv->lock);       << unlock
 		netdev_unlock(dev);
+		netdev_put(dev, &dev_tracker);
+		mutex_lock(&priv->lock);         << re-lock

The two marked ops are unnecessary. We only have to acquire the locks
in order. Its perfectly fine to release netdev_unlock() and keep holding
the socket lock.

  reply	other threads:[~2025-05-07 13:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 14:08 [PATCH net v2] net: devmem: fix kernel panic when socket close after module unload Taehee Yoo
2025-05-06 17:41 ` Stanislav Fomichev
2025-05-07  2:42   ` Jakub Kicinski
2025-05-07  4:22   ` Taehee Yoo
2025-05-06 22:07 ` Jakub Kicinski
2025-05-07  4:24   ` Taehee Yoo
2025-05-07  2:55 ` Jakub Kicinski
2025-05-07  4:55   ` Taehee Yoo
2025-05-07 13:23     ` Jakub Kicinski [this message]
2025-05-07 15:54       ` Taehee Yoo
2025-05-07 13:08 ` kernel test robot
2025-05-07 18:28 ` Mina Almasry
2025-05-08  9:59   ` Taehee Yoo
2025-05-08 20:45     ` Mina Almasry

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=20250507062321.4acdf9e6@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=skhawaja@google.com \
    --cc=willemb@google.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 NNTP newsgroup(s).