From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63F8023ABA7 for ; Wed, 8 Jul 2026 13:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783515876; cv=none; b=E0xSitZQE/1zJ2qOlEvExGHbMticBUagAlHabQkZpvoWWYCKFxt6A57vrL9YNEoVBUXRzBu61db+MdpTXdFmXB3bzIZ0Wv8ar/agG8ux8vAcULAcqnqZ5hSdC7xdRJGVOBBcYRz25n00uZ8If0TZJ6sUJFXIGXa284ZbHojekMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783515876; c=relaxed/simple; bh=TPmuL1ero5zv+WHjvwHCf1loe950mWpRMqA8MpPKYCA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U/4pFbBKuHtjzhXPpMVECsn/bI5sg0hEPSAEdSAuJVwe9564rpJDfjnctUqA2wh611+Uzz+Bbav08L1OToiVPcFpzx+0X7bwZ4I2vPkbyWz0qr0BIdtgey7n7C4aCJwg2vDfWtEwbsPRdwMZmeuDYWWTP8IAFgwGO62n4/w/FSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=YI5qyFe7; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YI5qyFe7" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-493b6f1b14bso2831725e9.0 for ; Wed, 08 Jul 2026 06:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783515874; x=1784120674; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/x6FSTkcJjBlea16+XEShOIorxoX9U0UFrtSrJcffgE=; b=YI5qyFe7tEZCsTz+ih+tFtd+C3xTfwWeqycM/atEgEyS4s3WQrW1tcxy2wWjQiAnyC DVAmhSUTaATJhG3Xamh6PbUYXiNIfpiJSLubeZgNA6DL6pRWX50q2PH6N30QWYwK+6ck YdKmwW7rlplvz4gDEaNdNQkJMA5RZ96NttJcgrvjGAkS1TUsVsis9HNQBu0hTHYR4Bqw pxWoLy1ymZsRqVNq90byKnqIHs7P81KZsdbX23mcR74L7nOhnf1ZPqiPnTK+vYe4yixN Fo3QuZyYWpq/Hry7rA/ahUiL7o6p9CY3LR1tfPDdx9ZJO/szkd0SLw7zYmNPBFpzfiZ9 isNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783515874; x=1784120674; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/x6FSTkcJjBlea16+XEShOIorxoX9U0UFrtSrJcffgE=; b=l9buGLGW60Lz7mBxGmbUsw3PTrvLjvLvJjJggV75xQy3W1Su7/4gnYNDHRswcAOqrC LZaAahFCja7fzndHPQHp4jmm5YnP4eYT3IvRSrzfJ1bgcH1qYxDfAJwhfjizDHGNaT+j WWrMGWdyeIhFjq35rEW6zH3g6jikDZEIz/1mkTwumt3uo7L66o8un89VGWIpP4wmJjlP cNAmOzbznRcLlstfq17Se7rhzGGLmP5sylL3jE+UgpZjjrCsnUBtyilJu1P8TCyPv1UF 1weovFWRS9cWuOaWz8Y4s8Fkb930kOhUlfqMCShu9aQhQ8gOQuW4iFiwDgAoqX/Ovthe MS9w== X-Forwarded-Encrypted: i=1; AHgh+RohWR+wBfc34Jv0rGEtqUKnwbep3rJ1KbnjcQeXJuYEjwa5t8toguQsli0wcjEeWxr5q925pJdRXMP2fzc=@vger.kernel.org X-Gm-Message-State: AOJu0YyWhNjP8eLBuncQUWmWQKKLPtOqyO9euSTNTK2Qy8fWRYuULkZI yHXLiL4YPpnv6MIo/Cj6Dj6Fd1t2jnz3g6vUya4WGpihsRIxk5YnnW4LFhIlQ1/2pWQ= X-Gm-Gg: AfdE7cl9cmaCP8dMEBoO6ahsOfxD6VTERghXT+pp/+0g3vITQQX62WY6kI19iYnEsUs +sv6vNAxLG95Zo6AOXhZSfOlxlLIsYMYjOmhsVxUi2LXbS9fowuAa6qX12vE5pPotQY4B3vf/I8 JbDhF4FX+UFX3qmAJeVV7VSYjr8CtDLI2EQ+JVFwj8Tgsmg98swJDohkhbEBOcFK1RC5fhYiUiT c0ofpI/tY/70LqjBn+JVR41ocsWb+xSw1L0cKq19TlbQ57RiGjcKmDWutfsgRdzgXNkSh3EKZA+ qPvn/JOWc68NlWJVAvZYWkoNMSHwWqc/TBFaCGuvFadmHcxq5FcW0M8ZUSkXwRlWSiOCoYRAFk5 uHbhp9Tgeld/IYrpu6tv1ze50/1nMlV2OTIqDWnchFj++D5yr02p8aHK5Q+kS56gF+S/tQJ/Yg0 mDrLYtjKzEtl5j7FVu1iv0Fqlq1D/9OVNynTdcr+GIeOuf X-Received: by 2002:a05:600c:1da8:b0:492:63c3:8eeb with SMTP id 5b1f17b1804b1-493e687cb4amr21521735e9.35.1783515873732; Wed, 08 Jul 2026 06:04:33 -0700 (PDT) Received: from [192.168.42.79] (nat2.prg.suse.com. [195.250.132.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e0f4e3afsm158975915e9.7.2026.07.08.06.04.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2026 06:04:33 -0700 (PDT) Message-ID: Date: Wed, 8 Jul 2026 15:04:32 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2] ppp: defer channel free to an RCU grace period to fix pppol2tp RX UAF To: Sebastian Andrzej Siewior 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" References: <87111f02-5b7a-4185-8364-2faba650578b@linux.dev> <20260706092926.PIlrhRKz@linutronix.de> <0dfe59c2-bf60-40fe-90e6-d6e1003709d0@suse.com> <20260708074904.xnpi0mlh@linutronix.de> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20260708074904.xnpi0mlh@linutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/8/26 9:49 AM, Sebastian Andrzej Siewior wrote: > 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. As RCU usage in modules is now more common, I see an argument for the module loader to invoke rcu_barrier() during module unload to make RCU usage easier. In general, module unloading is a rare operation, so even if it becomes somewhat slower, I don't expect it to be a significant issue. One problem is that I'm not sure where the new rcu_barrier() call should be placed. The prototype adds it before calling the module's exit function. Would this actually fit all modules? From a quick look, I can see that various modules call it at different points during their exit. -- Thanks, Petr