From nobody Sun Jan 26 22:33:23 2025 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yh5tW0RcFz5lh9t for ; Sun, 26 Jan 2025 22:33:39 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yh5tT5zC8z3rdv; Sun, 26 Jan 2025 22:33:37 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=VBQGx3pe; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::532 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5db689a87cbso7731165a12.3; Sun, 26 Jan 2025 14:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737930816; x=1738535616; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eQX4a62SVMODArTDPt3ZZF9QFzyK+KTBlnCXjdiB9mg=; b=VBQGx3peqXpPYkhzBuhCk6bbzP6lu9MR42Rg7HcKUaP+pL0QfEUG5HmSJGDeEGzGI/ w5UW23qKD1FjLx+nyeAaAH5zksrvD46wwlYny2NYS+BBGYIiipn4rfkUrEj8VPX/4NMy CjEIErZbC1C1tcwTTAL6tguatsmYG9qTcfnfyds6s5JpGkBu8Lrnyf658UxzDxY1akaK x7iUDpG+A72tjQWpefLBY7zj+gAoOfe4p+SffhgbMLZiXIDcxsRMn+bzrerCSOgJKzRY 8dltcKR4ebqA7+qsUSduy7189jMsuKzDIEYGk6B74O1zk/RWW/WOXZzSp1U5eRAYYB/c xcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737930816; x=1738535616; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eQX4a62SVMODArTDPt3ZZF9QFzyK+KTBlnCXjdiB9mg=; b=HC1TstgDDroItkIhc6Ttt3/+DaOnRNYlA9b69NkLjwc5iB7UVxrWXZLsb3W1jgqM5g 83L7amiCh+7h096TGZ3I3qVqPwN0zT74phJyXhplfDzw/m7HNONNL0d1Q2FIf7SmvZEo yQf51pgYfFZkevtFPV0YUruoiwInHYk7zJMegAbWBAqmIzufuHz8dcsy18TDLeU1ttn5 RJf42cKBc6k4kqurikrZkHZAqNAjDYKKSA4oTttfyihfNyntSAyFyorb2mf3m28Id/Bm YwNVfukTV2Bociz22eR0iHLMd3Q2WMY4z/zdnwWt2CPKGq7/HeOUkz7sjGJN6cTN+rx4 ZhmA== X-Forwarded-Encrypted: i=1; AJvYcCURaHjaaYwq3Wdq5pb1NWL7tQCaEyUbNpfcEaVcF75NSXua5VDNaeX+yuaTObz73v/oYb7vHXtgwQ==@freebsd.org X-Gm-Message-State: AOJu0YxS7ymNujk6JXXHe5NuABLH6TdVLOF2ilCin1+AXOt5brzaVApS mFbP9jOH2QRFgqy3rNOAcfcVWlRa2VPE6UeHgnjuH41Rd0tpzBCTGjphP3pZQ+ClCFt/f4ulqZU qha0luxB6yg6n9tVT36MfGBnUnlEjnTs= X-Gm-Gg: ASbGncu+/nMw/dzC8VZ697rYwIJ+sRTYqjE8lyXIFMss7MTylrTECIZWNGONOrMVLr3 s7eH8UTuKO0iy7awKQLb+sDPreQmN2QYfLYTmZ7xr5JTm01+cxx+84wFTKBOvth0cZ111hzmIHB +mzh5gni8kuX9A0cg7GUI= X-Google-Smtp-Source: AGHT+IEwlkQ3JhzRCvcGxHPtvnfpP+TqP4zLCpdCJ0BlihSIvpKWtEBBys5igUAQdiDiGnLo0sDTpKZhC7JhFQVwFLM= X-Received: by 2002:a05:6402:27cb:b0:5d9:f0d8:22e1 with SMTP id 4fb4d7f45d1cf-5db7d2f0b26mr36122623a12.9.1737930815588; Sun, 26 Jan 2025 14:33:35 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Rick Macklem Date: Sun, 26 Jan 2025 14:33:23 -0800 X-Gm-Features: AWEUYZlShSsIOl9peR8nbHh1X2oE6agsYb3VMgAWWU7GblGg_UHWxLYLT3nUpkQ Message-ID: Subject: Re: HEADS UP: NFS changes coming into CURRENT early February To: Gleb Smirnoff Cc: current@freebsd.org, rmacklem@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::532:from]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[current@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4Yh5tT5zC8z3rdv On Sun, Jan 26, 2025 at 1:44=E2=80=AFPM Rick Macklem wrote: > > On Tue, Jan 21, 2025 at 10:27=E2=80=AFPM Gleb Smirnoff wrote: > > > > CAUTION: This email originated from outside of the University of Guelph= . Do not click links or open attachments unless you recognize the sender an= d know the content is safe. If in doubt, forward suspicious emails to IThel= p@uoguelph.ca. > > > > > > Hi, > > > > TLDR version: > > users of NFS with Kerberos (e.g. running gssd(8)) as well as users of N= FS with > > TLS (e.g. running rpc.tlsclntd(8) or rpc.tlsservd(8)) as well as users = of > > network lock manager (e.g. having 'options NFSLOCKD' and running rpcbin= d(8)) > > are affected. You would need to recompile & reinstall both the world a= nd the > > kernel together. Of course this is what you'd normally do when you tra= ck > > FreeBSD CURRENT, but better be warned. I will post hashes of the speci= fic > > revisions that break API/ABI when they are pushed. > > > > Longer version: > > last year I tried to check-in a new implementation of unix(4) SOCK_STRE= AM and > > SOCK_SEQPACKET in d80a97def9a1, but was forced to back it out due to se= veral > > kernel side abusers of a unix(4) socket. The most difficult ones are t= he NFS > > related RPC services, that act as RPC clients talking to an RPC servers= in > > userland. Since it is impossible to fully emulate a userland process > > connection to a unix(4) socket they need to work with the socket intern= al > > structures bypassing all the normal KPIs and conventions. Of course th= ey > > didn't tolerate the new implementation that totally eliminated intermed= iate > > buffer on the sending side. > > > > While the original motivation for the upcoming changes is the fact that= I want > > to go forward with the new unix/stream and unix/seqpacket, I also tried= to make > > kernel to userland RPC better. You judge if I succeeded or not :) Here= are > > some highlights: > > > > - Code footprint both in kernel clients and in userland daemons is redu= ced. > > Example: gssd: 1 file changed, 5 insertions(+), 64 deletions(-) > > kgssapi: 1 file changed, 26 insertions(+), 78 deletions(-) > > 4 files changed, 1 insertion(+), 11 deletions(-) > > - You can easily see all RPC calls from kernel to userland with genl(1)= : > > # genl monitor rpcnl > > - The new transport is multithreaded in kernel by default, so kernel cl= ients > > can send a bunch of RPCs without any serialization and if the userlan= d > > figures out how to parallelize their execution, such parallelization = would > > happen. Note: new rpc.tlsservd(8) will use threads. > > - One ad-hoc single program syscall is removed - gssd_syscall. Note: > > rpctls syscall remains, but I have some ideas on how to improve that,= too. > > Not at this step though. > > - All sleeps of kernel RPC calls are now in single place, and they all = have > > timeouts. I believe NFS services are now much more resilient to hang= s. > > A deadlock when NFS kernel thread is blocked on unix socket buffer, a= nd > > the socket can't go away because its application is blocked in some o= ther > > syscall is no longer possible. > > > > The code is posted on phabricator, reviews D48547 through D48552. > > Reviewers are very welcome! > > > > I share my branch on Github. It is usually rebased on today's CURRENT: > > > > https://github.com/glebius/FreeBSD/commits/gss-netlink/ > > > > Early testers are very welcome! > Ok, I can now do minimal testing and crashed it... > > I did a mount with option "tls" and then partitioned it from the NFS serv= er > by doing "ifconfig bridge0 down". Waited until the TCP connection closed > and then did "ifconfig bridge0 up". > > The crash is a NULL pointer at rpctls_impl.c:255 (in rpctls_connect(), > called from nfscl_renewthread(). > The problem is that you made rpctls_connect_handle a vnet'd variable. > The client side (aka an NFS mount) does not happen inside a jail and > cannot use any vnet'd variables. > Why? Well, any number of threads enter the NFS client via VOP_xxx() > calls etc. Any one of them might end up doing a TCP reconnect when the > underlying TCP connection is broken and then heals. > > I don't know why you made rpctls_connect_handle a vnet'd variable, > but it cannot be that way. > (I once looked at making NFS mounts work inside a vnet prison and > gave up when I realized any old thread ends up in the code and it > would have taken many, many CURVNET_SET() calls to make it work.) > > In summary, no global variable on the client side can be vnet'd and no > global variable on the server side that is vnet'd can be shared with the > client side code. Ok,I now see you've fixed this crash. I'd still like to limit commits to main to the ones that are required to us= e netlink for the upcalls at this time. rick > > I realize you are enthusiastic about this, but I'd suggest you back off t= o > the minimal changes required to make this stuff work with netlink instead > of unix domain sockets and stick with that, at least for the initial > commit cycle. > > One thing to note is that few (if any) people who run main test this stuf= f. > It may be 1-2years before it sees third party testing and I can only do m= inimal > testing until at least April. > > Anyhow, thanks for all the good work you are doing with this, rick > > > > > -- > > Gleb Smirnoff > >