From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 461263FADF7; Wed, 8 Jul 2026 07:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783496959; cv=none; b=o1poZhEqH/XSvnG1++dePw7EuQ8qTYsxgYxEUUNIjuMaL+zmseoN756mlUWw5IdQFGupRR2w6/RJISp8pA2iiTR0j9u/AVwdkmdrBI1Wu++h/qfP3T0SEntW0xiz85Ghim/R+Fvvi4VzYdcBahdynLoG8CpYOr1p/9dWYillqeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783496959; c=relaxed/simple; bh=KEf4o7R7ZogucJeIjRsnOJwG+bKMIbkuRzlX3TWvFa8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eTw4GZa85ENGdpQVuwm3O0SMFKj+HIg6XCwc/LJWVcfH4MM7vjYBfrHLmXsuD51VPLeHrgMFyx02/CLfhSplOlSZuCVhn6crlWxCgc8gi/DHbcMJOtt8yJJYgxToq/MOzMWULIYa1TSKCxW2+54y04dd8x/HM+CcZXlHOInfJdc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hJEuMYy/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hOymlkcG; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hJEuMYy/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hOymlkcG" Date: Wed, 8 Jul 2026 09:49:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783496945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q/MW1MNnBl7YATXC2WRzPF6J/dhdpeXEHWQTTfhE+8s=; b=hJEuMYy/5qoHZcEgqMxU1DpTpcKT/FZzz6iZo004DGHcv6lq59xZiRwApY4crju1VxHxsd amr1gtjfk6Em43kW+dv3mHa4fGwXS4r0YYHdHmaEIN3R7u1ognTg/OhVsyp0YQcXBDnT0K XDyz1kbjokykibY3ZJBntyypKLdHnXEnQvFSER7t3rtGUnWqGlado6GVZnwSti5fWSUfmc 2SWEgWtDSIhC6BpL35hUXmWO/B6D/ZUPy5FzYXzbFVtKyuMi5IflVi9cYV4swFTUghTlmn U7hJRjVZKRoSZ96BIHSnOT/j09nohLH0zplmR15bxM0hbrvOjwMa4ESc+1A8HA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783496945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q/MW1MNnBl7YATXC2WRzPF6J/dhdpeXEHWQTTfhE+8s=; b=hOymlkcG3Mc9Q9C3Zzp0LGrlXG1OoASkQtelud0hLlqpgfb67BQ+HIem9JkHJRJqTCRisT PwwxTYmh5hXyBCCQ== From: Sebastian Andrzej Siewior To: Petr Pavlu Cc: Qingfang Deng , Breno Leitao , Norbert Szetei , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Taegu Ha , Kees Cook , linux-ppp@vger.kernel.org, linux-kernel@vger.kernel.org, Guillaume Nault , netdev@vger.kernel.org, Luis Chamberlain , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , linux-modules@vger.kernel.org, "Paul E. McKenney" Subject: Re: [PATCH net v2] ppp: defer channel free to an RCU grace period to fix pppol2tp RX UAF Message-ID: <20260708074904.xnpi0mlh@linutronix.de> References: <87111f02-5b7a-4185-8364-2faba650578b@linux.dev> <20260706092926.PIlrhRKz@linutronix.de> <0dfe59c2-bf60-40fe-90e6-d6e1003709d0@suse.com> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0dfe59c2-bf60-40fe-90e6-d6e1003709d0@suse.com> On 2026-07-07 17:32:10 [+0200], Petr Pavlu wrote: > > --- a/kernel/module/main.c > > +++ b/kernel/module/main.c > > @@ -858,6 +858,9 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, > > goto out; > > > > mutex_unlock(&module_mutex); > > + > > + /* Ensure all rcu callbacks issued by the module have completed */ > > + rcu_barrier(); > > /* Final destruction now no one is using it. */ > > if (mod->exit != NULL) > > mod->exit(); > > > > make sense? > > This is discussed in Documentation/RCU/rcubarrier.rst and > Documentation/RCU/Design/Requirements/Requirements.rst. The latter > contains: I am aware of this. It is just not the first time I stumble about this. But maybe with the AI review these days there won't be a miss. > I don't know if the last part about unacceptable latencies is still > relevant. I haven't done any measurements myself. There is a synchronize_rcu() later on. I think I could replace it with a call_rcu() so we might end up even. I was thinking about about it last time I was touching modules but somehow I stopped where I stopped. The question is just, is it worth doing it or is it reasonable to expect that it is done correctly. Sebastian