From nobody Fri Dec 10 00:16:44 2021 X-Original-To: bugs@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 D263D18CBB69 for ; Fri, 10 Dec 2021 00:16:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J9BKS2wBKz4YJF for ; Fri, 10 Dec 2021 00:16:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3980C1073A for ; Fri, 10 Dec 2021 00:16:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1BA0Gi73046112 for ; Fri, 10 Dec 2021 00:16:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1BA0GiHs046111 for bugs@FreeBSD.org; Fri, 10 Dec 2021 00:16:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260300] SECINFO_NO_NAME with PARENT and a file crashes NFS v4 server Date: Fri, 10 Dec 2021 00:16:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639095404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHjIeZtkRpajYXfXX9K2cC0bP/EOkUBNiHnWhkJBA4E=; b=wiu/0xUAOU/iNanTax2PMw9sC/092Ah7tMUOKu6yJoFljd2tKLRbS6ambN5Lu43NYqCyFq Pf1FG9TueCBddFwvskD5LffrFxIr+oBGqK4w1ETCwg+8DMjQkzilgyY//rJpBpqgTWoVtF 4A3/NBEVE14I50a21vS6Y9OCbfqn2ZTFGuXktzwY4a9ETMIDq+JDZV4oy7n9j9CNGwIA3W kxC/iHF4W3ZJpjgMex2bCby8FWdpHE7JNHdwo8CtAT0t/iwzAFjcgODSv38wwzTQOQ9SVU /li/aaF64LNXAryr+tKmcZjF97AnDGYG5bQuSLLyIxwcu1uFshBAVPQTr7K5RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639095404; a=rsa-sha256; cv=none; b=Tv8rrGnNFK/eQmbLC+xZNmVnGzqzOOqPwtdrmP7RrWaJWdD2tnyaG2f0YNoXFj4TmhHpes Hu1D/1QCXYlPZHa4K9+yZe+FB6QizHpceJoALmkB8nsIuQzvhar+gsbfpuPWEdqy/kFccD e3fxlT7ojrEm8OKas4sAX4Hi25kstC6SdIrsB4fX/Y8VCo5JELCjBWkbm6ACwBli/4cu4d Lokh055e+t4y03Ww8rXFeJzJ80oj4Cqydp07oO6DbMzq9kGYaF+2GcVqoDrYQ02/V5ow7K Pl2Fd7Pe7yLpZ27jti5F+huQIFK3W1lKovMDveJGgUN6/zY8AfhjlPD/vW4GLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260300 Bug ID: 260300 Summary: SECINFO_NO_NAME with PARENT and a file crashes NFS v4 server Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Attachment #230004 text/plain mime type: Created attachment 230004 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D230004&action= =3Dedit Crash an NFS v4 server with a bad SECINFO_NO_NAME RPC. If the client sends a SECINFO_NO_NAME RPC with style=3DPARENT, and the current file handle refers to a file (not a directory), nfsrvd_secinfononame() calls nfsvno_namei() to look up ".." relative to that file. nfsvno_namei() returns ENOTDIR, and does not modify ni_startdir. But nfsrvd_secinfononame() calls vrele() on named.ni_startdir, which was never initialized. I've attached a demo. Exception 6 is a RISC-V mis-aligned atomic operation. # uname -a FreeBSD 14.0-CURRENT FreeBSD 14.0-CURRENT #141 main-n250910-5ebdc4cea5b6-dirty: Thu Dec 9 18:01:04 EST 2021=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv # cc fnfsd_13.c # ./a.out ... panic: Unknown kernel exception 6 trap value ffffffc00025f562 --- exception 6, tval =3D 0xffffffc00025f562 atomic_fetchadd_32() at atomic_fetchadd_32+0x8 refcount_releasen() at refcount_releasen+0x1c refcount_release() at refcount_release+0xc vrele() at vrele+0x14 nfsrvd_secinfononame() at nfsrvd_secinfononame+0x120 nfsrvd_compound() at nfsrvd_compound+0xdc8 nfsrvd_dorpc() at nfsrvd_dorpc+0x294 nfs_proc() at nfs_proc+0x11a nfssvc_program() at nfssvc_program+0x426 svc_executereq() at svc_executereq+0xa2 svc_run_internal() at svc_run_internal+0x302 svc_run() at svc_run+0x146 nfsrvd_nfsd() at nfsrvd_nfsd+0x194 nfssvc_nfsd() at nfssvc_nfsd+0x300 sys_nfssvc() at sys_nfssvc+0xdc syscallenter() at syscallenter+0xf4 ecall_handler() at ecall_handler+0x18 do_trap_user() at do_trap_user+0xea cpu_exception_handler_user() at cpu_exception_handler_user+0x72 --=20 You are receiving this mail because: You are the assignee for the bug.=