mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 徐晗翔 <xuhx@hust.edu.cn>
To: trondmy@kernel.org, anna@kernel.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: SUNRPC: rpc_switch_client_transport() removes the client pipedir without pipefs_sb_lock, racing the RPC_PIPEFS_UMOUNT notification chain into a double removal (UAF)
Date: Thu, 26 Nov 2026 20:55:07 +0800 (GMT+08:00)	[thread overview]
Message-ID: <26fdf638.13c9.1a217ec88c1.Coremail.xuhx@hust.edu.cn> (raw)
In-Reply-To: <2026102727-data-sequel-ce41@gregkh>

[-- Attachment #1: Type: text/plain, Size: 11405 bytes --]

------------------------------------------------------------------------

rpc_switch_client_transport() (net/sunrpc/clnt.c) is the NFSv4
migration/referral transport-replacement path (nfs4_update_server(),
fs/nfs/nfs4client.c).  After switching transports it calls
rpc_unregister_client() and then __rpc_clnt_remove_pipedir() -- and
that second call is the only place in the file that touches the client
pipedir WITHOUT holding sn->pipefs_sb_lock.  Every other mutator --
rpc_clnt_remove_pipedir(), the RPC_PIPEFS_MOUNT/RPC_PIPEFS_UMOUNT
notification handlers, and the killers rpc_fill_super()/rpc_kill_sb()
-- runs under that mutex.  When a umount of rpc_pipefs is in flight,
rpc_kill_sb() holds pipefs_sb_lock and walks sn->all_clients through
the notification chain, handing out bare client pointers; the umount
side and the switch side can therefore both read the same non-NULL
clnt->pipefs_sb, cl_pipedir_objects.pdh_dentry and pipe->dentry before
either clears them, and both execute the same removal sequence:
double rpc_remove_client_dir()/simple_recursive_removal() on the same
dentries, a second rpc_close_pipes() on a pipe whose
RPC_I(inode)->pipe has already been cleared (spin_lock(&pipe->lock) on
a NULL pointer), and unsynchronised accesses to clnt->pipefs_sb and
pdh_dentry.  Verified on mainline 7.3 with a choreographed reproducer:
the resumed umount-side removal oopses with a NULL-pointer write to
inode->i_rwsem (address 0x98) inside __simple_recursive_removal(),
followed by slab-use-after-free reports on the corrupted pipefs_sb_lock
state; the VM does not survive the resulting lockup.

The detailed description:

* Test environment / affected version

  Linux version 7.3.0 (gcc 13.3.0, GNU ld 2.42) #1 SMP PREEMPT_DYNAMIC
  -- vanilla mainline 7.3 tree; net/sunrpc/clnt.c and
  net/sunrpc/rpc_pipe.c are byte-identical between the audited tree
  and 7.3, line numbers below are from 7.3.  Tested with KASAN enabled
  in QEMU/KVM x86_64.

* Mechanism

  The unlocked call site (clnt.c:765-766 in
  rpc_switch_client_transport()):

    rpc_unregister_client(clnt);
    __rpc_clnt_remove_pipedir(clnt);        /* NO pipefs_sb_lock */

  __rpc_clnt_remove_pipedir() (clnt.c:97-103) reads clnt->pipefs_sb
  without synchronisation and, if non-NULL, calls
  rpc_remove_client_dir() (rpc_pipe.c:890-900), which reads
  pdh_dentry (a borrowed dentry reference, no lock, no refcount),
  runs rpc_destroy_pipe_dir_objects() over the pdh_entries (for each
  pipe_dir_object: rpc_unlink(pipe), i.e.
  simple_recursive_removal(pipe->dentry, rpc_close_pipes) followed by
  the unlocked "pipe->dentry = NULL"), then sets pdh_dentry = NULL and
  calls simple_recursive_removal(D, NULL) on the pipedir dentry
  itself, and finally clears clnt->pipefs_sb.

  The concurrent side is rpc_kill_sb() (rpc_pipe.c:1188-1208), which
  holds pipefs_sb_lock, sets sn->pipefs_sb = NULL and synchronously
  dispatches RPC_PIPEFS_UMOUNT through the blocking notifier chain;
  the handler walks sn->all_clients via
  rpc_get_client_for_event() (bare pointer, no reference;
  a client with a pipedir is not skipped for UMOUNT,
  clnt.c:174-176) and executes the identical removal sequence in
  __rpc_clnt_handle_event() (clnt.c:194-199):
  "if (clnt->pipefs_sb == sb) { __rpc_clnt_remove_pipedir(clnt);
  clnt->pipefs_sb = NULL; }".

  Both sequences start from the same unsynchronised reads.  When they
  overlap (the umount side's scan happens before the switch side's
  rpc_unregister_client() removes the client from the list, or
  concurrently with it), both read pdh_dentry == D and pipe->dentry ==
  pd before either clears them, and then:

    1. Both run rpc_unlink() on the same pipe: both see a non-NULL
       pipe->dentry and both call simple_recursive_removal(pd,
       rpc_close_pipes).  The first invocation frees pd; the second
       resumes on the freed/discarded dentry.  Depending on where the
       two threads interleave inside rpc_close_pipes() (rpc_pipe.c:
       170-195), the second invocation either reads
       RPC_I(inode)->pipe after the first one cleared it and does
       spin_lock(&pipe->lock) on a NULL pointer -- a kernel oops --
       or, if it read it earlier, runs pipe->ops->release_pipe(inode)
       a second time (gss_pipe_release() twice ->
       put_pipe_version() twice -> sn->pipe_users underflow and a
       corrupted pipe_version state machine, i.e. every RPCSEC_GSS
       upcall in that netns stalls with -EAGAIN).

    2. Both run simple_recursive_removal(D, NULL) on the pipedir
       dentry, and both run the plain (unsynchronised) writes to
       clnt->pipefs_sb and pdh_dentry -- KCSAN-visible data races
       even when the interleaving stays benign.

* Trigger model

  Both knobs are root-domain operations: umount/mount of rpc_pipefs
  requires CAP_SYS_ADMIN in the initial user namespace (the rpc_pipefs
  fs_type has no FS_USERNS_MOUNT), and the transport switch is reached
  through NFSv4 migration/referral recovery --
  nfs4_replace_transport() -> nfs4_try_replacing_one_location()
  (fs/nfs/nfs4namespace.c) -> nfs4_update_server() ->
  rpc_switch_client_transport() (fs/nfs/nfs4client.c:1183).  The
  client's pipedir entries are plain in-tree dentries
  (d_make_persistent) and do not pin the mount, so nothing structurally
  prevents the umount from proceeding while a transport switch is
  running; the rpc_kill_sb() notifier only needs the client's
  clnt->pipefs_sb to still equal the dying superblock, which is the
  normal state before the switch side clears it.  Consequence: kernel
  oops (NULL-pointer write), dentry/inode corruption, and a
  permanently wedged pipefs_sb_lock for everything else in that netns.

* Reproducer (attached: rpcrace.c) and results on 7.3

  rpcrace.c builds the exact preconditions with exported APIs (no
  kernel-source changes): it creates a client whose pipedir carries a
  child pipe object (rpc_mkpipe_data() + rpc_add_pipe_dir_object(),
  mirroring what a sec=krb5 client gets from its gss pipes), then a
  kprobe stalls the umount task inside
  simple_recursive_removal() -- filtered to calls with callback ==
  rpc_close_pipes (address resolved at runtime from /proc/kallsyms)
  and comm == "umount" -- while a module thread drives
  rpc_switch_client_transport() against the stalled umount.  A
  release timer lets the umount resume after the switch side's
  unlocked removal has completed.  This widens the natural
  microseconds window deterministically, following the
  controlled-window methodology; it does not by itself measure natural
  hit rates.

  Results (7.3, KASAN, QEMU 8 vCPU): the resumed umount-side removal
  reports "BUG: KASAN: null-ptr-deref in down_write -- Write of size 8
  at address 0x98 (= inode->i_rwsem) by task umount" with the stack
  umount -> rpc_kill_sb -> blocking_notifier_call_chain ->
  rpc_pipefs_event -> rpc_remove_client_dir -> rpc_unlink ->
  __simple_recursive_removal, followed by "BUG: KASAN:
  slab-use-after-free in mutex_spin_on_owner" on the corrupted lock
  state; the virtual machine then hangs and is torn down by the
  harness.  A note on the manifestation shape: dcache frees dentries
  via RCU and dentry_unlink_inode() clears d_inode synchronously
  during the first removal, so the resumed access hits a still
  allocated-but-detached dentry and surfaces as the NULL-pointer write
  above rather than a dentry slab-use-after-free report; the follow-up
  mutex owner read does report a slab-use-after-free.  Full serial log
  and report excerpts are available on request.

* Fix

  The patch below replaces the unlocked __rpc_clnt_remove_pipedir()
  with the locked helper rpc_clnt_remove_pipedir(), which takes
  pipefs_sb_lock, only removes the pipedir when clnt->pipefs_sb still
  matches the mounted superblock, and releases the lock -- making the
  switch path identical to every other pipedir mutator in the file and
  serialising it against both notification chains.  One-line change;
  reviewed against the audit interleaving but not runtime-tested (the
  race itself is dynamically verified as described above).  Happy to
  test.

  Please keep me in Cc; I am not subscribed to the lists.

Regards,
Hanxiang Xu <xuhx@hust.edu.cn>

------------------------------------------------------------------------

The patch (text/plain; apply with patch -p1 or git am):

From: Hanxiang Xu <xuhx@hust.edu.cn>
Subject: [PATCH] SUNRPC: remove the client pipedir under pipefs_sb_lock
 in rpc_switch_client_transport()

rpc_switch_client_transport() calls __rpc_clnt_remove_pipedir()
without holding sn->pipefs_sb_lock.  It is the only pipedir mutator in
the file that does so; every other one (rpc_clnt_remove_pipedir() and
the RPC_PIPEFS_MOUNT/UMOUNT notification handlers, dispatched from
rpc_fill_super()/rpc_kill_sb()) runs under that mutex.

Because the notification chains hand out bare client pointers and both
sides read the same clnt->pipefs_sb, cl_pipedir_objects.pdh_dentry and
pipe->dentry without synchronisation, a concurrent umount of rpc_pipefs
and a transport switch (NFSv4 migration/referral recovery,
nfs4_update_server()) can both enter the removal sequence for the same
pipedir: double rpc_remove_client_dir()/simple_recursive_removal() on
the same dentries, a second rpc_close_pipes() whose
RPC_I(inode)->pipe has already been cleared (NULL-pointer
spin_lock(&pipe->lock) oops), a double gss_pipe_release() (pipe_users
underflow corrupting the RPCSEC_GSS pipe-version state machine), and
unsynchronised clnt->pipefs_sb / pdh_dentry accesses.

Use the locked rpc_clnt_remove_pipedir() helper -- it takes
pipefs_sb_lock, only removes the pipedir when clnt->pipefs_sb still
matches the mounted superblock, and releases the lock -- making the
switch path identical to the rest of the file.  Verified by a
choreographed reproducer (kprobe-stalled umount inside
simple_recursive_removal() while rpc_switch_client_transport() runs
its unlocked removal): before the patch the resumed umount oopses with
a NULL-pointer write to inode->i_rwsem followed by slab-use-after-free
reports on the corrupted lock state.

Signed-off-by: Hanxiang Xu <xuhx@hust.edu.cn>
---
 net/sunrpc/clnt.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -763,7 +763,19 @@
 	oldxps = xprt_iter_xchg_switch(&clnt->cl_xpi, xps);
 
 	rpc_unregister_client(clnt);
-	__rpc_clnt_remove_pipedir(clnt);
+	/*
+	 * Remove the pipedir under pipefs_sb_lock.  The unlocked
+	 * __rpc_clnt_remove_pipedir() races the RPC_PIPEFS_UMOUNT and
+	 * RPC_PIPEFS_MOUNT notification chains (rpc_kill_sb() and
+	 * rpc_fill_super() run them while holding pipefs_sb_lock): both
+	 * sides can read the same non-NULL clnt->pipefs_sb /
+	 * cl_pipedir_objects.pdh_dentry / pipe->dentry before either
+	 * clears them, producing double rpc_remove_client_dir()/
+	 * simple_recursive_removal() on the same dentries, a second
+	 * rpc_close_pipes() on a pipe whose RPC_I(inode)->pipe was
+	 * already cleared, and unsynchronised clnt->pipefs_sb accesses.
+	 */
+	rpc_clnt_remove_pipedir(clnt);
 	rpc_sysfs_client_destroy(clnt);
 	rpc_clnt_debugfs_unregister(clnt);
 
 net/sunrpc/clnt.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletions(-)


------------------------------------------------------------------------------------------------------------------------------------------------

[-- Attachment #2: rpcrace.c --]
[-- Type: text/plain, Size: 21734 bytes --]

// SPDX-License-Identifier: GPL-2.0
/*
 * rpcrace.c - controlled-window verification instruments for the net/sunrpc
 * conditional-race audit cases SUNRPC-MR-01..04
 * (docs/manual-review-net-sunrpc-2026-11-25.md, v4).
 *
 * Methodology follows this environment's established controlled-window
 * precedent (r4_stall.c, r1stall.c, fx*): zero kernel-source changes; a
 * loadable module drives exported core APIs (rpc_create, rpcauth_register,
 * rpc_switch_client_transport, rpc_mkpipe_data/rpc_add_pipe_dir_object,
 * cache_create_net/sunrpc_cache_upcall) and kprobe pre-handlers widen the
 * natural race windows into deterministic choreographies.
 *
 * Modes (module param "mode"):
 *  mr03pfs - SUNRPC-MR-03 pipefs flavor.  Custom authops->create() holds the
 *            rpc_client_register() failure window open until a userspace
 *            helper has open(2)'d the failing client's <pipefs>/nfs/clntXX/info
 *            file (open takes a cl_count reference via rpc_info_open).  After
 *            the window closes rpc_new_client() kfree()s the client anyway
 *            and the helper read()s/closes the fd -> use-after-free in
 *            rpc_show_info()/rpc_info_release().
 *  mr03dbg - same choreography against the debugfs "tasks" file
 *            (/sys/kernel/debug/sunrpc/rpc_clnt/<clid>/tasks, tasks_open
 *            takes the cl_count reference; full_proxy_release forwards
 *            tasks_release unconditionally).  Only meaningful on a kernel
 *            built with CONFIG_SUNRPC_DEBUG (debugfs.c compiled in).
 *  mr01    - SUNRPC-MR-01.  Double-kprobe choreography:
 *            kp1 = rpc_unregister_client entry, claimed by our failing
 *            client thread at err_auth (after rpc_get_sb_net() already saw
 *            pipefs unmounted and released pipefs_sb_lock);
 *            kp2 = rpc_create_client_dir entry, claimed by the concurrent
 *            "mount -t rpc_pipefs" notifier while it holds pipefs_sb_lock
 *            and has already written clnt->pipefs_sb = sb.
 *            Release order (A resumes -> unregister/remove/kfree, then B
 *            resumes) reproduces the audited interleaving: B writes
 *            pdh_dentry into the freed rpc_clnt (UAF write) and leaves an
 *            orphan pipedir whose info file private points at freed memory.
 *  mr04    - SUNRPC-MR-04.  kprobe stall on simple_recursive_removal() when
 *            called with callback == rpc_close_pipes from the umount task,
 *            while a module thread drives rpc_switch_client_transport()
 *            (which calls __rpc_clnt_remove_pipedir() WITHOUT
 *            pipefs_sb_lock).  Both threads read the same pdh_dentry /
 *            pipe->dentry before either clears it -> the umount thread
 *            resumes simple_recursive_removal() on the already-freed pipe
 *            child dentry (use-after-free).
 *  mr02    - SUNRPC-MR-02 (KCSAN kernel).  Module-owned cache_detail
 *            ("racetest", /proc/net/rpc/racetest/channel) + an upcall
 *            feeder; userspace runs two concurrent readers and a
 *            FIONREAD ioctl loop against the shared cache_request so that
 *            cache_read()/cache_read()/cache_ioctl() race on rq->buf and
 *            rq->len (plain, unsynchronised accesses).
 *
 * Handshake with userspace (see scripts/init-rpcrace):
 *   /sys/module/rpcrace/parameters/event        - readonly state machine
 *   /sys/module/rpcrace/parameters/helper_ready - write 1 to complete the
 *         window (mr03*); mr01/mr04 choreograph internally.
 */
#define pr_fmt(fmt) "RPCRACE: " fmt

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kprobes.h>
#include <linux/kthread.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/kref.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/atomic.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/auth.h>
#include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/cache.h>
#include <linux/sunrpc/xprt.h>
#include <linux/sunrpc/stats.h>

static char *mode = "mr03pfs";
static int hold_ms = 8000;
static int iters = 2;
static int stall_ms = 4000;
static int secs = 30;
static int auth_ok;
static unsigned long cb_addr;
static bool do_hold;

module_param(mode, charp, 0400);
module_param(hold_ms, int, 0400);
module_param(iters, int, 0400);
module_param(stall_ms, int, 0400);
module_param(secs, int, 0400);
module_param(auth_ok, int, 0400);
module_param(cb_addr, ulong, 0400);
MODULE_PARM_DESC(mode, "mr03pfs | mr03dbg | mr01 | mr04 | mr02");
MODULE_PARM_DESC(cb_addr, "runtime address of rpc_close_pipes (mr04)");

/* ------------------------------------------------------------------ */
/* state machine                                                       */
/*  event==1 : A stalled / window open (helper may act)                */
/*  event==2 : B stalled (mr01: mount inside create_client_dir;        */
/*             mr04: umount inside simple_recursive_removal)           */
/*  event==3 : failing client freed / done                             */
/* ------------------------------------------------------------------ */
static atomic_t race_state = ATOMIC_INIT(0);
static DECLARE_COMPLETION(helper_compl);
static DECLARE_COMPLETION(go_compl);
static struct task_struct *worker;
static int kp_unreg_hit, kp_ccd_hit, kp_srr_hit;

/* ------------------------- fake rpc program ------------------------ */
static u32 race_counts[1];
static const struct rpc_procinfo race_procs[1] = { { 0 } };
static const struct rpc_version race_v1 = {
	.number		= 1,
	.nrprocs	= 1,
	.procs		= race_procs,
	.counts		= race_counts,
};
static const struct rpc_version *race_version[1] = { &race_v1 };
static struct rpc_stat race_stat;
static const struct rpc_program race_program = {
	.name		= "rpcrace",
	.number		= 200000,
	.nrvers		= 1,
	.version	= race_version,
	.stats		= &race_stat,
	.pipe_dir_name	= "nfs",	/* exists in rpc_pipefs root */
};

/* ------------------------- fake rpc auth --------------------------- */
static void race_auth_destroy(struct rpc_auth *auth) { }
static struct rpc_auth race_fake_auth;

/*
 * create() is called from rpcauth_create() inside rpc_client_register()
 * (clnt.c L322) - i.e. AFTER the client was published to sn->all_clients
 * (L318) and after the pipefs pipedir was created (L313-315).  Holding this
 * callback open holds the audited publication window open (mr03*).
 */
static struct rpc_auth *
race_auth_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
{
	if (auth_ok) {
		refcount_set(&race_fake_auth.au_count, 1);
		return &race_fake_auth;
	}
	if (do_hold) {
		pr_info("window OPEN (hold_ms=%d), clnt=%p clid=%d\n",
			hold_ms, clnt, clnt->cl_clid);
		atomic_set(&race_state, 1);
		wait_for_completion_timeout(&helper_compl,
					    msecs_to_jiffies(hold_ms));
	}
	return ERR_PTR(-EINVAL);
}

static const struct rpc_authops race_authops = {
	.owner		= THIS_MODULE,
	.au_flavor	= RPC_AUTH_KRB,		/* 4, unregistered in-kernel */
	.au_name	= "rpcrace",
	.create		= race_auth_create,
	.destroy	= race_auth_destroy,
};

/* ------------------------- kprobe machinery ------------------------ */
static atomic_t arm = ATOMIC_INIT(0);
static atomic_t release_flag = ATOMIC_INIT(0);

static void spin_until(int target)
{
	unsigned long until = jiffies + msecs_to_jiffies(stall_ms);

	while (atomic_read(&race_state) < target && time_before(jiffies, until))
		cpu_relax();
}

/* mr01 kp1: rpc_unregister_client entry on the failing-client thread */
static int mr01_kp_unreg_pre(struct kprobe *p, struct pt_regs *regs)
{
	if (!atomic_read(&arm) || kp_unreg_hit || current != worker)
		return 0;
	kp_unreg_hit = 1;
	atomic_set(&race_state, 1);
	pr_info("kp1: failing thread stalled at err_auth unregister "
		"(rpc_get_sb_net already returned NULL)\n");
	spin_until(2);
	pr_info("kp1: mount side stalled -> releasing failing thread\n");
	return 0;
}

/* mr01 kp2: rpc_create_client_dir entry on the mount task */
static int mr01_kp_ccd_pre(struct kprobe *p, struct pt_regs *regs)
{
	if (!atomic_read(&arm) || kp_ccd_hit || !kp_unreg_hit)
		return 0;
	if (strncmp(current->comm, "mount", 5) != 0)
		return 0;
	kp_ccd_hit = 1;
	atomic_set(&race_state, 2);
	pr_info("kp2: mount notifier stalled inside rpc_create_client_dir "
		"(holds pipefs_sb_lock, clnt->pipefs_sb already written)\n");
	spin_until(3);
	pr_info("kp2: failing client freed -> resuming create_client_dir "
		"on freed rpc_clnt\n");
	return 0;
}

/* mr04 kp: simple_recursive_removal(dentry, callback==rpc_close_pipes) */
static int mr04_kp_srr_pre(struct kprobe *p, struct pt_regs *regs)
{
	if (!atomic_read(&arm) || kp_srr_hit)
		return 0;
#ifdef CONFIG_X86_64
	if (!cb_addr || regs->si != cb_addr)
		return 0;
#else
	return 0;
#endif
	if (strncmp(current->comm, "umount", 6) != 0)
		return 0;
	kp_srr_hit = 1;
	atomic_set(&race_state, 2);
	pr_info("kp: umount stalled inside simple_recursive_removal(pipe child)\n");
	{
		unsigned long until = jiffies + msecs_to_jiffies(stall_ms * 2);

		while (!atomic_read(&release_flag) &&
		       time_before(jiffies, until))
			cpu_relax();
	}
	pr_info("kp: switch-side removal done -> resuming removal on freed "
		"pipe dentry\n");
	return 0;
}

static struct kprobe kp_unreg = { .symbol_name = "rpc_unregister_client",
				  .pre_handler = mr01_kp_unreg_pre };
static struct kprobe kp_ccd = { .symbol_name = "rpc_create_client_dir",
				.pre_handler = mr01_kp_ccd_pre };
static struct kprobe kp_srr = { .symbol_name = "simple_recursive_removal",
				.pre_handler = mr04_kp_srr_pre };

/*
 * mr04: the switch thread blocks on pipefs_sb_lock inside the re-register
 * (the stalled umount holds the mutex), so the release is driven by a timer
 * armed just before rpc_switch_client_transport(): the switch's unlocked
 * __rpc_clnt_remove_pipedir() completes in microseconds, well within the
 * 2s window; the umount thread then resumes on the freed pipe dentry.
 */
static struct timer_list mr04_rel_timer;

static void mr04_rel_timer_fn(struct timer_list *t)
{
	atomic_set(&release_flag, 1);
	pr_info("mr04: release timer fired\n");
}

/* ------------------------- client helpers -------------------------- */
static struct rpc_clnt *race_make_client(bool want_ok)
{
	struct sockaddr_in sin = {
		.sin_family	= AF_INET,
		.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
		.sin_port	= htons(2049),
	};
	struct rpc_create_args args = {
		.net		= current->nsproxy->net_ns,
		.protocol	= XPRT_TRANSPORT_TCP,
		.address	= (struct sockaddr *)&sin,
		.addrsize	= sizeof(sin),
		.servername	= "racetest",
		.program	= &race_program,
		.version	= 0,
		.authflavor	= RPC_AUTH_KRB,
		.cred		= current_cred(),
		.flags		= RPC_CLNT_CREATE_NOPING,
	};

	auth_ok = want_ok ? 1 : 0;
	return rpc_create(&args);
}

/* ------------------------- mr03 worker ----------------------------- */
static int mr03_threadfn(void *unused)
{
	int i;

	wait_for_completion(&go_compl);
	for (i = 0; i < iters; i++) {
		struct rpc_clnt *clnt;

		reinit_completion(&helper_compl);
		clnt = race_make_client(false);
		if (!IS_ERR(clnt)) {
			pr_err("unexpected success, aborting\n");
			rpc_shutdown_client(clnt);
			break;
		}
		pr_info("iteration %d: rpc_create failed (%ld); client freed "
			"while file references were held\n", i, PTR_ERR(clnt));
		atomic_set(&race_state, 3);
		msleep(300);
	}
	atomic_set(&race_state, 3);
	pr_info("mr03 done\n");
	return 0;
}

/* ------------------------- mr01 worker ----------------------------- */
static int mr01_threadfn(void *unused)
{
	struct rpc_clnt *clnt;

	wait_for_completion(&go_compl);
	kp_unreg_hit = 0;
	kp_ccd_hit = 0;
	/* pipefs must be unmounted at create time; kp1 stalls the err_auth
	 * unregister; the helper's concurrent mount stalls inside
	 * rpc_create_client_dir via kp2; release order reproduces the
	 * audited interleaving. */
	atomic_set(&arm, 1);
	clnt = race_make_client(false);
	atomic_set(&arm, 0);
	if (!IS_ERR(clnt)) {
		pr_err("mr01: unexpected success\n");
		rpc_shutdown_client(clnt);
	} else {
		pr_info("mr01: rpc_create failed (%ld)\n", PTR_ERR(clnt));
	}
	atomic_set(&race_state, 3);
	return 0;
}

/* ------------------------- mr04 machinery -------------------------- */
struct race_pdo {
	struct rpc_pipe_dir_object pdo;
	struct rpc_pipe *pipe;
};

static struct rpc_clnt *mr04_clnt;
static struct race_pdo mr04_rp;

static ssize_t race_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
				char __user *dst, size_t buflen)
{
	return rpc_pipe_generic_upcall(filp, msg, dst, buflen);
}

static const struct rpc_pipe_ops race_pipe_ops = {
	.upcall		= race_pipe_upcall,
};

static int race_pdo_create(struct dentry *dir, struct rpc_pipe_dir_object *pdo)
{
	struct race_pdo *rp = pdo->pdo_data;

	return rpc_mkpipe_dentry(dir, "racetest", NULL, rp->pipe);
}

static void race_pdo_destroy(struct dentry *dir, struct rpc_pipe_dir_object *pdo)
{
	struct race_pdo *rp = pdo->pdo_data;

	rpc_unlink(rp->pipe);
}

static const struct rpc_pipe_dir_object_ops race_pdo_ops = {
	.create		= race_pdo_create,
	.destroy	= race_pdo_destroy,
};

static int mr04_setup(void)
{
	int ret;

	mr04_clnt = race_make_client(true);	/* want_ok: fake valid auth */
	if (IS_ERR(mr04_clnt))
		return PTR_ERR(mr04_clnt);

	mr04_rp.pipe = rpc_mkpipe_data(&race_pipe_ops, 0);
	ret = PTR_ERR_OR_ZERO(mr04_rp.pipe);
	if (ret)
		goto out_clnt;
	mr04_rp.pdo.pdo_data = &mr04_rp;
	rpc_init_pipe_dir_object(&mr04_rp.pdo, &race_pdo_ops, &mr04_rp);
	ret = rpc_add_pipe_dir_object(rpc_net_ns(mr04_clnt),
				      &mr04_clnt->cl_pipedir_objects,
				      &mr04_rp.pdo);
	if (ret)
		goto out_pipe;
	pr_info("mr04: client clid=%d armed with pipedir + child pipe\n",
		mr04_clnt->cl_clid);
	return 0;
out_pipe:
	rpc_destroy_pipe_data(mr04_rp.pipe);
out_clnt:
	rpc_shutdown_client(mr04_clnt);
	mr04_clnt = NULL;
	return ret;
}

static void mr04_cleanup(void)
{
	if (mr04_clnt)
		rpc_shutdown_client(mr04_clnt);
	mr04_clnt = NULL;
}

static int mr04_threadfn(void *unused)
{
	struct sockaddr_in sin = {
		.sin_family	= AF_INET,
		.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
		.sin_port	= htons(2049),
	};
	struct xprt_create xargs = {
		.ident		= XPRT_TRANSPORT_TCP,
		.net		= rpc_net_ns(mr04_clnt),
		.dstaddr	= (struct sockaddr *)&sin,
		.addrlen	= sizeof(sin),
		.servername	= "racetest",
	};
	int ret, i;

	/* wait for the umount thread to stall inside simple_recursive_removal */
	{
		unsigned long until = jiffies + msecs_to_jiffies(stall_ms * 4);

		while (atomic_read(&race_state) < 2 &&
		       time_before(jiffies, until))
			msleep(1);
	}
	if (atomic_read(&race_state) < 2) {
		pr_err("mr04: umount side never stalled, aborting\n");
		return 0;
	}
	pr_info("mr04: driving rpc_switch_client_transport() against the "
		"stalled umount\n");
	timer_setup(&mr04_rel_timer, mr04_rel_timer_fn, 0);
	/* 300ms: the switch-side unlocked removal completes in microseconds,
	 * while the freed dentries are still inside the KASAN quarantine when
	 * the umount thread resumes (clean slab-use-after-free instead of a
	 * post-reuse crash). */
	mod_timer(&mr04_rel_timer, jiffies + msecs_to_jiffies(300));
	for (i = 0; i < 3; i++) {
		ret = rpc_switch_client_transport(mr04_clnt, &xargs, NULL);
		pr_info("mr04: switch attempt %d -> %d\n", i, ret);
		if (ret == 0)
			break;
		msleep(50);
	}
	timer_delete_sync(&mr04_rel_timer);
	atomic_set(&release_flag, 1);
	atomic_set(&race_state, 3);
	return 0;
}

/* ------------------------- mr02 machinery -------------------------- */
static struct cache_detail *race_cd;
static struct task_struct *feeder;
static bool feeder_run = true;

static void race_cache_put(struct kref *ref) { }

static void race_cache_request(struct cache_detail *cd, struct cache_head *h,
			       char **bpp, int *blen)
{
	/* deterministic, comfortably-sized upcall text */
	qword_add(bpp, blen, (char *)"racetest");
	qword_add(bpp, blen, (char *)"filler-line-for-concurrent-formatting-race");
	qword_add(bpp, blen, (char *)"0123456789012345678901234567890123456789");
	qword_add(bpp, blen, (char *)"0123456789012345678901234567890123456789");
	if (*blen > 0)
		(*bpp)[-1] = '\n';
}

static struct cache_head *race_alloc(void)
{
	return kzalloc_obj(struct cache_head, GFP_KERNEL);
}

static int race_match(struct cache_head *a, struct cache_head *b) { return 1; }
static void race_init_h(struct cache_head *a, struct cache_head *b) { }
static void race_update(struct cache_head *a, struct cache_head *b) { }

static struct cache_detail race_cd_template = {
	.owner		= THIS_MODULE,
	.hash_size	= 16,
	.name		= "racetest",
	.cache_put	= race_cache_put,
	.cache_request	= race_cache_request,
	.alloc		= race_alloc,
	.match		= race_match,
	.init		= race_init_h,
	.update		= race_update,
};

static int mr02_setup(void)
{
	int ret;

	race_cd = cache_create_net(&race_cd_template, current->nsproxy->net_ns);
	if (IS_ERR(race_cd))
		return PTR_ERR(race_cd);
	ret = cache_register_net(race_cd, current->nsproxy->net_ns);
	if (ret)
		goto out_free;
	pr_info("mr02: channel at /proc/net/rpc/racetest/channel\n");
	return 0;
out_free:
	cache_destroy_net(race_cd, current->nsproxy->net_ns);
	race_cd = NULL;
	return ret;
}

static void mr02_cleanup(void)
{
	if (!race_cd)
		return;
	feeder_run = false;
	if (feeder && !IS_ERR(feeder)) {
		kthread_stop(feeder);
		feeder = NULL;
	}
	cache_unregister_net(race_cd, current->nsproxy->net_ns);
	cache_destroy_net(race_cd, current->nsproxy->net_ns);
	race_cd = NULL;
}

static int mr02_threadfn(void *unused)
{
	unsigned long until = jiffies + secs * HZ;

	while (feeder_run && time_before(jiffies, until)) {
		struct cache_head *h = race_alloc();

		if (h) {
			memset(h, 0, sizeof(*h));
			INIT_HLIST_NODE(&h->cache_list);
			kref_init(&h->ref);
			h->expiry_time = seconds_since_boot() + 3600;
			h->last_refresh = seconds_since_boot();
			sunrpc_cache_upcall(race_cd, h);
			/* h intentionally left pending: the rq stays on
			 * cd->requests for the readers to race on; the
			 * per-item leak is bounded by the run duration. */
		}
		usleep_range(1000, 2000);
	}
	pr_info("mr02: feeder done\n");
	return 0;
}

/* ------------------------- module glue ----------------------------- */
static int helper_ready_get(char *buf, const struct kernel_param *kp)
{
	return sprintf(buf, "%d\n", atomic_read(&race_state) >= 1 ? 1 : 0);
}

static int helper_ready_set(const char *val, const struct kernel_param *kp)
{
	int v;

	if (kstrtoint(val, 0, &v))
		return -EINVAL;
	if (v) {
		pr_info("helper_ready -> window closing\n");
		complete(&helper_compl);
	}
	return 0;
}

static const struct kernel_param_ops helper_ready_ops = {
	.flags	= KERNEL_PARAM_OPS_FL_NOARG,
	.get	= helper_ready_get,
	.set	= helper_ready_set,
};
module_param_cb(helper_ready, &helper_ready_ops, NULL, 0600);

static int event_get(char *buf, const struct kernel_param *kp)
{
	return sprintf(buf, "%d\n", atomic_read(&race_state));
}

static const struct kernel_param_ops event_ops = {
	.flags	= KERNEL_PARAM_OPS_FL_NOARG,
	.get	= event_get,
};
module_param_cb(event, &event_ops, NULL, 0444);

static int __init rpcrace_init(void)
{
	int ret;

	do_hold = !strcmp(mode, "mr03pfs") || !strcmp(mode, "mr03dbg");
	pr_info("mode=%s hold_ms=%d iters=%d stall_ms=%d secs=%d cb_addr=0x%llx\n",
		mode, hold_ms, iters, stall_ms, secs, (unsigned long long)cb_addr);

	if (!strcmp(mode, "mr03pfs") || !strcmp(mode, "mr03dbg")) {
		ret = rpcauth_register(&race_authops);
		if (ret)
			return ret;
		worker = kthread_run(mr03_threadfn, NULL, "rpcraceA");
		ret = PTR_ERR_OR_ZERO(worker);
		if (!ret)
			complete(&go_compl);
		return ret;
	}

	if (!strcmp(mode, "mr01")) {
		ret = register_kprobe(&kp_unreg);
		if (ret)
			return ret;
		ret = register_kprobe(&kp_ccd);
		if (ret) {
			unregister_kprobe(&kp_unreg);
			return ret;
		}
		worker = kthread_run(mr01_threadfn, NULL, "rpcraceA");
		ret = PTR_ERR_OR_ZERO(worker);
		if (ret) {
			unregister_kprobe(&kp_ccd);
			unregister_kprobe(&kp_unreg);
			return ret;
		}
		/* thread blocks on go_compl; release after worker assigned */
		complete(&go_compl);
		return 0;
	}

	if (!strcmp(mode, "mr04")) {
		if (!cb_addr) {
			pr_err("mr04 requires cb_addr=<rpc_close_pipes>\n");
			return -EINVAL;
		}
		ret = rpcauth_register(&race_authops);
		if (ret)
			return ret;
		ret = mr04_setup();
		if (ret) {
			rpcauth_unregister(&race_authops);
			return ret;
		}
		ret = register_kprobe(&kp_srr);
		if (ret) {
			mr04_cleanup();
			return ret;
		}
		atomic_set(&arm, 1);
		worker = kthread_run(mr04_threadfn, NULL, "rpcraceA");
		if (IS_ERR(worker)) {
			unregister_kprobe(&kp_srr);
			atomic_set(&arm, 0);
			mr04_cleanup();
			return PTR_ERR(worker);
		}
		return 0;
	}

	if (!strcmp(mode, "mr02")) {
		ret = mr02_setup();
		if (ret)
			return ret;
		feeder = kthread_run(mr02_threadfn, NULL, "rpcraceF");
		if (IS_ERR(feeder)) {
			mr02_cleanup();
			return PTR_ERR(feeder);
		}
		return 0;
	}

	return -EINVAL;
}

static void __exit rpcrace_exit(void)
{
	if (!strcmp(mode, "mr03pfs") || !strcmp(mode, "mr03dbg")) {
		if (worker && !IS_ERR(worker))
			kthread_stop(worker);
		rpcauth_unregister(&race_authops);
	} else if (!strcmp(mode, "mr01")) {
		atomic_set(&arm, 0);
		if (worker && !IS_ERR(worker))
			kthread_stop(worker);
		unregister_kprobe(&kp_ccd);
		unregister_kprobe(&kp_unreg);
	} else if (!strcmp(mode, "mr04")) {
		atomic_set(&arm, 0);
		atomic_set(&release_flag, 1);
		if (worker && !IS_ERR(worker))
			kthread_stop(worker);
		unregister_kprobe(&kp_srr);
		mr04_cleanup();
		rpcauth_unregister(&race_authops);
	} else if (!strcmp(mode, "mr02")) {
		mr02_cleanup();
	}
	pr_info("exit\n");
}

module_init(rpcrace_init);
module_exit(rpcrace_exit);
MODULE_LICENSE("GPL");

      parent reply	other threads:[~2026-11-26 12:55 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 12:35 usb: devio: usbdev_release() has no barrier against an in-flight async_completed() callback (use-after-free window on struct usb_dev_state)gregkh@linuxfoundation.org 徐晗翔
2026-10-27 14:12 ` Greg KH
2026-11-03 11:21   ` mm/slub: has_pcs_used() reads remote per-CPU sheaf state from flush_all_cpus_locked() without synchronization (data race; KCSAN blind spot: slub.o is uninstrumented) 徐晗翔
2026-11-04  9:41     ` Qing Wang
2026-11-04 10:07       ` Qing Wang
2026-11-03 11:30   ` futex/hrtimer: hrtimer_sleeper::task is read unsynchronized in 16 places on v7.3 -- the accessor series that fixes this is not in 7.3; please make sure it reaches the affected trees (backport nudge + stock-kernel KCSAN evidence) 徐晗翔
2026-11-03 11:48   ` cgroup: fork vs cgroup.procs write race in favordynmods mode -- v7.3 is affected; please make sure bf6fbf46b5ff reaches the stable trees (repro incl. uninstrumented natural hit) 徐晗翔
2026-11-03 14:51     ` Sasha Levin
2026-11-03 11:57   ` net: rtnetlink: rtnl_link_unregister() vs in-flight RTM_GETLINK dump readers -- v7.3 lacks the synchronize_rcu() fix (Fixes: 6b57ff21a310 family); A/B reproduction on stock 7.3 徐晗翔
2026-11-03 15:49     ` Eric Dumazet
2026-11-04 15:03     ` Sasha Levin
2026-11-03 12:07   ` wifi: wilc1000: SDIO/SPI remove destroys the srcu_struct before wiphy_unregister() -- late cfg80211 callbacks write through dangling srcu state (unfixed upstream; controlled + natural Oops) 徐晗翔
2026-11-03 12:10   ` gpio: gpiolib: final put of the gpio_device happens inside the SRCU read critical section on the setup-failure path -- deterministic use-after-free read at guard release (unfixed upstream) 徐晗翔
2026-11-05  8:52     ` Linus Walleij
2026-11-04 12:54   ` soc: qcom: pmic_glink_altmode: fix use-after-free on unbind (no cancel_work_sync for port work and enable_work) 徐晗翔
2026-11-04 13:04     ` Greg KH
2026-11-04 12:57   ` usb: typec: anx7411: unregister partner/altmodes before stopping the IRQ work -- use-after-free, double unregister, orphan partner on remove 徐晗翔
2026-11-04 13:28     ` Greg KH
2026-11-04 12:58   ` usb: typec: ucsi: deadlock on cros_ec unbind -- connector lock held across cancel_delayed_work_sync vs the mode-selection work's unbounded trylock polling 徐晗翔
2026-11-04 13:00   ` usb: typec: stusb160x/rt1719/hd3ss3220: IRQ thread vs remove -- double unregister / use-after-free on the partner and port 徐晗翔
2026-11-04 13:01   ` usb: typec: ucsi: displayport: data race on dp->header/ vdo_data/vdo_size -- work reads them unlocked while writers hold con->lock (VDM mismatch) 徐晗翔
2026-11-04 13:02   ` usb: typec: class: three lifetime/locking gaps around the mux/switch handles and mode_selection (drvdata UAF after provider unbind; no concurrent protocol for set/put; unlocked state_update vs delete) 徐晗翔
2026-11-10 12:56   ` driver core: uevent: netns teardown frees uevent_sock while a tagged uevent is still being broadcast (UAF) 徐晗翔
2026-11-10 13:00   ` 徐晗翔
2026-11-10 18:48     ` Greg KH
2026-11-10 13:05   ` ACPI: CPPC: per-CPU cpc_desc is freed on processor unbind without clearing the published pointer, causing UAF in cpufreq accessors 徐晗翔
2026-11-10 13:07   ` ACPI: CPPC: shared PCC subspace data can be freed while another CPU probes, reads, or tears it down 徐晗翔
2026-11-10 14:47     ` Christian Loehle
2026-11-10 13:11   ` ACPI: ACPICA: Reset can delete an event semaphore while another thread is blocked in Wait 徐晗翔
2026-11-10 13:14   ` power: supply: bq25890: pump-express work can call power_supply_changed after the psy is unregistered 徐晗翔
2026-11-10 13:17   ` power: supply: core: get/set property callbacks can run after unregister and read freed driver data 徐晗翔
2026-11-10 13:18   ` power: supply: core: system-battery enumeration can return an unregistered battery 徐晗翔
2026-11-10 13:21   ` power: supply: core: changed work can run after unregister and use freed LED triggers 徐晗翔
2026-11-10 13:23   ` power: supply: bq24190: IRQ handler can call power_supply_changed after the psy is unregistered 徐晗翔
2026-11-10 13:34   ` 徐晗翔
2026-11-11  7:17   ` genirq: NMI dispatch reads struct irqaction with no quiescence -- use-after-free across free_nmi()'s kfree (x86 verification on the arch-independent core path) 徐晗翔
2026-11-11  7:26   ` genirq: NMI API lacks the request_mutex / dev_id matching / idempotency semantics that free_irq() has -- double free_nmi releases chip PM and module references twice (verified) 徐晗翔
2026-11-11  7:30   ` kernfs: kernfs_drain()'s fast-path decision reads the active count without acquire ordering -- on weakly-ordered architectures the forced ->release()/unmap can be skipped 徐晗翔
2026-11-11 13:41     ` Greg KH
2026-11-13 11:58   ` ALSA: ctxfi: free atimer only after the timer IRQ is quiesced 徐晗翔
2026-11-13 16:30     ` Takashi Iwai
2026-11-25 12:51       ` [PATCH] Re: " 徐晗翔
2026-11-25 14:33         ` Takashi Iwai
2026-11-13 12:03   ` ALSA: ctxfi: do not free a running system timer when timer_delete_sync_try() returns -1 (UAF) 徐晗翔
2026-11-25 12:51     ` [PATCH] " 徐晗翔
2026-11-25 14:35       ` Takashi Iwai
2026-11-26  2:13         ` 徐晗翔
2026-11-26  7:54           ` Takashi Iwai
2026-11-13 12:04   ` ALSA: asihpi: free IRQ before snd_card_free()/HPI delete on HPI6205 removal (UAF) 徐晗翔
2026-11-25 12:50     ` [PATCH] " 徐晗翔
2026-11-25 14:43       ` Takashi Iwai
2026-11-13 12:06   ` ALSA: asihpi: quiesce PCM timer and IRQ before freeing dpcm on close (UAF) 徐晗翔
2026-11-25 12:50     ` [PATCH] " 徐晗翔
2026-11-25 14:46       ` Takashi Iwai
2026-11-13 12:15   ` ALSA: pcm: link-group walk in timer callback can use a closed substream's freed runtime (UAF) 徐晗翔
2026-11-25 12:55     ` [PATCH] " 徐晗翔
2026-11-25 13:27       ` Takashi Iwai
2026-11-13 12:28   ` ALSA: usb-audio: us144mkii: PCM close frees runtime while playback/feedback URB completion and capture work still use it (UAF) 徐晗翔
2026-11-25 12:48     ` [PATCH] " 徐晗翔
2026-11-25 16:25       ` Takashi Iwai
2026-11-13 12:29   ` ALSA: usb-audio: us144mkii: queued stop_pcm_work calls snd_pcm_stop() after PCM close and dereferences NULL runtime 徐晗翔
2026-11-25 12:49     ` [PATCH] " 徐晗翔
2026-11-13 12:33   ` sched/topology: old domain chains are queued for RCU freeing before the per-CPU pointers are updated, so a late reader can still dereference a freed sched_domain and sched_domain_shared (UAF) 徐晗翔
2026-11-13 12:47   ` xfs: use-after-free in stats_clear sysctl handler during module unload 徐晗翔
2026-11-13 12:48   ` xfs: data races on xfs_params and xfs_globals tunables 徐晗翔
2026-11-17 12:32   ` jbd2: fix unsynchronized read of j_average_commit_time in procfs stats (KCSAN data race) 徐晗翔
2026-11-17 12:33   ` jbd2: read j_stats.ts_tid under j_history_lock in fast commit path " 徐晗翔
2026-11-17 12:35   ` jbd2: fix unlocked read/write of j_last_sync_writer in jbd2_journal_stop " 徐晗翔
2026-11-17 12:38   ` btrfs: compression: data race on compr_pool.count between shrinker scan and folio alloc/free " 徐晗翔
2026-11-17 12:47   ` fs/ceph: debugfs mdsmap_show() can dereference a freed MDS map after a concurrent map update (UAF) 徐晗翔
2026-11-17 12:48   ` fs/ceph: ceph_statfs() can dereference a freed MDS map (double evaluation of mdsc->mdsmap) (UAF) 徐晗翔
2026-11-17 12:49   ` fs/ceph: ceph_get_tree() out_splat path walks mdsc->mdsmap without mdsc->mutex (UAF) 徐晗翔
2026-11-17 12:50   ` fs/ceph: __ceph_setxattr() reads mdsmap->m_max_xattr_size " 徐晗翔
2026-11-17 12:51   ` fs/ceph: MDS reconnect paths read mdsc->mdsmap " 徐晗翔
2026-11-17 12:52   ` fs/ceph: caps renew paths read mdsmap->m_session_timeout " 徐晗翔
2026-11-24 14:53     ` Krzysztof Kozlowski
2026-11-17 12:53   ` fs/ceph: MDS connections can deliver CEPH_MSG_MDS_MAP and re-enter ceph_mdsc_handle_mdsmap() (UAF) 徐晗翔
2026-11-22  7:37   ` mm/hugetlb: a min_size-only hugetlbfs subpool is kfree()d before its last pinned page is released, so free_huge_folio() takes a spinlock on freed memory (UAF) 徐晗翔
2026-11-22 15:58     ` David Hildenbrand (Arm)
2026-11-25 12:05     ` David Hildenbrand (Arm)
2026-11-26  5:52       ` Ackerley Tng
2026-11-26  6:39         ` David Hildenbrand (Arm)
2026-11-22  7:39   ` io_uring/zcrx: copy statistics lose updates when one ifq is shared by multiple rings (Data race) 徐晗翔
2026-11-23 13:50     ` Pavel Begunkov
2026-11-24 17:17       ` Clément Léger
2026-11-22  7:43   ` sound: core: compress offload fd does not pin card or module, so card removal leaves a live fd pointing at freed snd_compr (KASAN UAF) 徐晗翔
2026-11-22  8:07     ` Takashi Iwai
2026-11-25 12:44       ` [PATCH] Re: " 徐晗翔
2026-11-25 14:21         ` Takashi Iwai
2026-11-22  7:48   ` sound: core: jack kcontrol is published before jack_kctl allocation, and the failure path frees it without removing it from card->controls (null-ptr-deref) 徐晗翔
2026-11-24  9:39     ` Sreeraj S Kurup
2026-11-25 12:43       ` 徐晗翔
2026-11-22  7:50   ` sound: core: rawmidi input close can re-queue event_work after cancel_work_sync() (UAF) 徐晗翔
2026-11-24 14:52     ` Krzysztof Kozlowski
2026-11-25 12:45       ` [PATCH] Re: " 徐晗翔
2026-11-25 14:37         ` Takashi Iwai
2026-11-22  7:52   ` sound: core: hwdep DSP_LOAD check-then-act is unlocked, allowing concurrent DSP_LOAD callbacks (UAF) 徐晗翔
2026-11-25 12:46     ` [PATCH] " 徐晗翔
2026-11-25 14:14       ` Takashi Iwai
2026-11-22  7:55   ` sound: core: get_available_index() calls snd_ctl_find_id() without controls_rwsem (UAF risk) 徐晗翔
2026-11-25 12:46     ` [PATCH] " 徐晗翔
2026-11-25 14:18       ` Takashi Iwai
2026-11-22  7:56   ` sound: core: OSS mixer notify callback is invoked without module pin or mutex, racing with rmmod 徐晗翔
2026-11-25 12:47     ` [PATCH] " 徐晗翔
2026-11-25 14:16       ` Takashi Iwai
2026-11-22  7:57   ` sound: timer: snd_utimer_fops lacks .owner, so an open user timer fd does not pin snd-timer 徐晗翔
2026-11-25 12:48     ` [PATCH] " 徐晗翔
2026-11-25 14:17       ` Takashi Iwai
2026-11-26 12:49   ` SUNRPC: rpc_new_client() kfree()s a fully published client on the auth-creation failure path -- use-after-free via concurrent rpc_pipefs mount notifications and via open debugfs/pipefs files (UAF) 徐晗翔
2026-11-26 12:52   ` SUNRPC: cache_read() serialises readers with a per-open inode lock, but every open() gets a fresh inode: concurrent formatting of the shared upcall buffer and unsynchronised rq->len (Data Race KCSAN-confirmed) 徐晗翔
2026-11-26 12:55   ` 徐晗翔 [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=26fdf638.13c9.1a217ec88c1.Coremail.xuhx@hust.edu.cn \
    --to=xuhx@hust.edu.cn \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@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

all inboxes | Powered by JetHome®