From: Shuvam Pandey <shuvampandey1@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Simon Horman <horms@kernel.org>
Subject: [PATCH v2 0/3] mISDN: fix socket/device lifetime and naming races
Date: Fri, 17 Apr 2026 23:34:25 +0545 [thread overview]
Message-ID: <cover.1776446840.git.shuvampandey1@gmail.com> (raw)
In-Reply-To: <20260414071322.30851-1-shuvampandey1@gmail.com>
This is a respin of the original get_mdevice() reference leak fix.
Patch 1 makes unregister wait for the last device reference and closes
sockets that still point at the device before delete_stack() runs. It
also serializes bind against unregister so a new socket cannot attach
once teardown has started.
Patch 2 drops the temporary get_mdevice() references from IMGETDEVINFO
and IMSETDEVNAME, and serializes those ioctl paths against unregister.
Patch 3 keeps an mISDN-owned copy of the device name so ioctl, sysfs, and
debug paths no longer depend on the kobject name storage remaining stable
across device_rename().
Previous discussion:
https://lore.kernel.org/r/20260414071322.30851-1-shuvampandey1@gmail.com
This series was developed with AI assistance. I reviewed, revised, and
tested it, and I take responsibility for the submission.
---
Changes in v2:
- split the fix into three focused patches
- close sockets before delete_stack() and wait for the final device release
- serialize bind and ioctl lookup/rename paths against unregister
- cache stable device names for mISDN paths outside the kobject
- keep existing debug behavior while switching layer1 name reads to the cached name
- document the device_lock(dev) -> lock_sock(sk) ordering
- build-test the series on arm64 with W=1 for drivers/isdn/mISDN and
drivers/isdn/hardware/mISDN
Shuvam Pandey (3):
mISDN: serialize socket teardown against device unregister
mISDN: socket: drop temporary references from get_mdevice()
mISDN: cache stable device names outside the kobject
drivers/isdn/mISDN/core.c | 37 ++++-
drivers/isdn/mISDN/core.h | 1 +
drivers/isdn/mISDN/layer1.c | 2 +-
drivers/isdn/mISDN/socket.c | 263 +++++++++++++++++++++++++++++++-----
drivers/isdn/mISDN/stack.c | 36 ++---
drivers/isdn/mISDN/tei.c | 2 +-
include/linux/mISDNif.h | 2 +
7 files changed, 284 insertions(+), 59 deletions(-)
--
2.50.1 (Apple Git-155)
next prev parent reply other threads:[~2026-04-17 17:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 7:13 [PATCH] mISDN: socket: drop device references acquired by get_mdevice() Shuvam Pandey
2026-04-16 12:50 ` Simon Horman
2026-04-16 14:50 ` Shuvam Pandey
2026-04-17 17:49 ` Shuvam Pandey [this message]
2026-04-17 17:49 ` [PATCH v2 1/3] mISDN: serialize socket teardown against device unregister Shuvam Pandey
2026-04-17 17:49 ` [PATCH v2 2/3] mISDN: socket: drop temporary references from get_mdevice() Shuvam Pandey
2026-04-17 17:49 ` [PATCH v2 3/3] mISDN: cache stable device names outside the kobject Shuvam Pandey
2026-04-19 0:24 ` [PATCH v2 0/3] mISDN: fix socket/device lifetime and naming races Shuvam Pandey
2026-04-20 17:11 ` Jakub Kicinski
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=cover.1776446840.git.shuvampandey1@gmail.com \
--to=shuvampandey1@gmail.com \
--cc=horms@kernel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.