mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Unsung Lee <unsung0317@gmail.com>
To: Vasileios Almpanis <vasilisalmpanis@gmail.com>
Cc: Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	Benjamin Coddington <bcodding@hammerspace.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NFS: sysfs: fix use-after-free on delayed kobject release
Date: Sat, 21 Nov 2026 19:35:50 +0900	[thread overview]
Message-ID: <20261121103550.1537739-1-unsung0317@gmail.com> (raw)
In-Reply-To: <20260803-nfs-v1-1-034176dab4a3@gmail.com>

On Mon, Aug 03, 2026, Vasileios Almpanis wrote:
> struct nfs_netns_client embeds two kobjects and is freed by
> nfs_netns_object_release(), the release function of nfs_net_kobj.
> Despite that the first one, p->kobject lives in the same allocation.
> Nothing keeps the allocation from being freed before p->kobject
> has been released.

[...]

I ran into the same KASAN report with CONFIG_DEBUG_KOBJECT_RELEASE=y:
a slab-use-after-free in __run_timers() on memory allocated by
nfs_netns_sysfs_setup() and freed by kobject_delayed_cleanup(), after
a network namespace was torn down.

Tested on v7.3.1 and v7.4-rc3 in a QEMU guest with KASAN, running
"for i in $(seq 16); do unshare -n true; done; sleep 20" after boot.
Without the patch, 3 of 3 boots hit the report on each kernel (on
v7.4-rc3 already during boot). With the patch, 10 boots on each kernel
gave no KASAN reports, and lockdep stayed enabled.

The test runs were automated with an LLM coding assistant.

Tested-by: Unsung Lee <unsung0317@gmail.com>

      parent reply	other threads:[~2026-11-21 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  9:18 Vasileios Almpanis
2026-08-04 12:58 ` Benjamin Coddington
2026-08-27 13:20 ` Vasileios Almpanis
2026-11-21 10:35 ` Unsung Lee [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=20261121103550.1537739-1-unsung0317@gmail.com \
    --to=unsung0317@gmail.com \
    --cc=anna@kernel.org \
    --cc=bcodding@hammerspace.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    --cc=trondmy@kernel.org \
    --cc=vasilisalmpanis@gmail.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

all inboxes | Powered by JetHome®