From nobody Fri Nov 26 20:26:59 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 0E4AA18B8D85 for ; Fri, 26 Nov 2021 20:27:00 +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 4J15rM4WJHz3RC7 for ; Fri, 26 Nov 2021 20:26:59 +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 6D38672A3 for ; Fri, 26 Nov 2021 20:26:59 +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 1AQKQxE3081911 for ; Fri, 26 Nov 2021 20:26:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1AQKQxB8081910 for bugs@FreeBSD.org; Fri, 26 Nov 2021 20:26:59 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 260071] bad slotid in SEQUENCE reply can crash NFS v4 client Date: Fri, 26 Nov 2021 20:26:59 +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=1637958419; 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=AgNsNQkF7PLrhgwy0Ykt62Fk3LhmIs4qACrz+tjby+I=; b=t2Jn3H/bOPW/o3oMuFNnzDrYD/Lg5AqjyNSjnl1EA5ZupJvvKtUI/AxHz3QL3txefiRHMF EUF2dOfji8n0IHOUmaUj7VUkYUu4VZw0XNF0/ofQs4nbQ/N+2cnHLKYeXmL0q36OSyXFx7 YD8cuZvWPv9z1XHTngSYre9X30EDmiah4+IeJ45YavJ/cdpFVH6ahY2BOOosG7WSJTWwYk RdpUtbeMD66HVTzR5mUknNbSJnuwKwIkt5VCtdY1lou0dBDGrwfu7mfjotE4TeryW0X8yE cdrpxpDEHXjt2BdWhJQnDg8k6G7/zzyJUbT1qsXpYN06Vq9cRiG6yNNeIAE81w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637958419; a=rsa-sha256; cv=none; b=KDu10Bb/YhcRp48zMLTU9qg3jmC4BLpwtMUQl74TRgEWh0gTHZuKHN84cgKzJ3PiLzQQvf hd83SKwQhDbgIen5zOweD9CwM/pSyTljkEB4bPt0sQanojP3Cz6b1x2MFdufKJvulyK6vZ l7OYKc2cj4fC3pi1sem2Y2vn8i0nBj1XwIwEl2ym6d0DSDVV/XtO8o8xyzccTFp9S7kLJn ojY3SUrn2kp10wO2TpZwgkkeEVa5rYDUhjBJPbtzUnHQynos2hz45wMjsbNztgXlx18FvX a3F08dx0BNcWKIMBKmnPHKWjyYpVnKWm9xtJ8h7bSPIYJJpgeQgV9jd85MNoTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260071 Bug ID: 260071 Summary: bad slotid in SEQUENCE reply can crash NFS v4 client 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 #229750 text/plain mime type: Created attachment 229750 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229750&action= =3Dedit A demo of an nfs v4 server crashing the client with a negative slotid. This code in newnfs_request() uses a slot number sent by the server to index into an array without bounds-checking: slot =3D fxdr_unsigned(int, *tl++); freeslot =3D slot; if (retseq !=3D sep->nfsess_slotseq[slot]) printf("retseq diff 0x%x\n", retseq); I've attached a demo: # uname -a FreeBSD 14.0-CURRENT FreeBSD 14.0-CURRENT #103 main-n250903-2a29c1558e82-dirty: Fri Nov 26 13:54:28 EST 2021=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv # cc fnfs_3.c # ./a.out ... panic: Fatal page fault at 0xffffffc000207f4c: 0xffffffce02bf4cc0 --- exception 13, tval =3D 0xffffffce02bf4cc0 newnfs_request() at newnfs_request+0x1002 nfsrpc_reclaimcomplete() at nfsrpc_reclaimcomplete+0x92 nfsrpc_setclient() at nfsrpc_setclient+0x630 nfscl_getcl() at nfscl_getcl+0x53e mountnfs() at mountnfs+0x722 nfs_mount() at nfs_mount+0x161e vfs_mount_sigdefer() at vfs_mount_sigdefer+0x20 vfs_domount_first() at vfs_domount_first+0x1d4 vfs_domount() at vfs_domount+0x21c vfs_donmount() at vfs_donmount+0x79c sys_nmount() at sys_nmount+0x66 do_trap_user() at do_trap_user+0x206 cpu_exception_handler_user() at cpu_exception_handler_user+0x72 --=20 You are receiving this mail because: You are the assignee for the bug.=