Re: [LSF/MM/BPF TOPIC] Namespace-aware upcalls from kernel filesystems
Shyam Prasad N <[email protected]>
| Newsgroups | org.kernel.vger.keyrings,org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <CANT5p=qmNsBEDuMFjNUUV15hgnZ8_pQjjJo0HD0Aj-ezL9vM+Q@mail.gmail.com> |
On Tue, Feb 17, 2026 at 8:48 PM Jeff Layton <[email protected]> wrote: > > On Tue, 2026-02-17 at 09:21 -0500, Chuck Lever wrote: > > > > On Mon, Feb 16, 2026, at 11:14 PM, Shyam Prasad N wrote: > > > On Sat, Feb 14, 2026 at 9:10 PM Chuck Lever <[email protected]> wrote: > > > > > > > > > > > > On Sat, Feb 14, 2026, at 5:06 AM, Shyam Prasad N wrote: > > > > > Kernel filesystems sometimes need to upcall to userspace to get some > > > > > work done, which cannot be achieved in kernel code (or rather it is > > > > > better to be done in userspace). Some examples are DNS resolutions, > > > > > user authentication, ID mapping etc. > > > > > > > > > > Filesystems like SMB and NFS clients use the kernel keys subsystem for > > > > > some of these, which has an upcall facility that can exec a binary in > > > > > userspace. However, this upcall mechanism is not namespace aware and > > > > > upcalls to the host namespaces (namespaces of the init process). > > > > > > > > Hello Shyam, we've been introducing netlink control interfaces, which > > > > are namespace-aware. The kernel TLS handshake mechanism now uses > > > > this approach, as does the new NFSD netlink protocol. > > > > > > > > > > > > -- > > > > Chuck Lever > > > > > > Hi Chuck, > > > > > > Interesting. Let me explore this a bit more. > > > I'm assuming that this is the file that I should be looking into: > > > fs/nfsd/nfsctl.c > > > > Yes, clustered towards the end of the file. NFSD's use of netlink > > is as a downcall-style administrative control plane. > > > > net/handshake/netlink.c uses netlink as an upcall for driving > > kernel-initiated TLS handshake requests up to a user daemon. This > > mechanism has been adopted by NFSD, the NFS client, and the NVMe > > over TCP drivers. An in-kernel QUIC implementation is planned and > > will also be using this. > > > > > > > And that there would be a corresponding handler in nfs-utils? > > > > For NFSD, nfs-utils has a new tool called nfsdctl. > > > > The TLS handshake user space components are in ktls-utils. See: > > https://github.com/oracle/ktls-utils > > > I think the consensus at this point is to move away from usermodehelper > as an upcall mechanism. The Linux kernel lacks a container object that > allows you to associate namespaces with one another, so you need an > already-running userspace process to do that association in userland. > > netlink upcalls are bound to a network namespace. That works in the > above examples because they are also bound to a network namespace. > netlink upcalls require a running daemon in that namespace, which is > what ties that network namespace to other sorts of namespaces. As long as the "connection" is initiated from the userspace, I think it should be aware of all namespaces (not just net namespace). As you said, this will also mean that there's a need for a daemon to watch this fd. > > So, a related discussion we should have is whether and how we should > deprecate the old usermodehelper upcalls, given that they are > problematic in this way. I see a few other users of UMH: coredump, initrd, kmod and kobject. https://elixir.bootlin.com/linux/v6.19.3/C/ident/call_usermodehelper_setup Based on the descriptions, most of these are used in early boot or are done in subsystems that don't need namespace awareness. To me, request_key is the odd one out here. I think we should have upcall handlers in the different namespaces to watch for upcalls. > -- > Jeff Layton <[email protected]> -- Regards, Shyam