From nobody Sat Nov 27 12:11:46 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 1B02F18ABFF6 for ; Sat, 27 Nov 2021 12:11:47 +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 4J1VpV4V11z4k1j for ; Sat, 27 Nov 2021 12:11:46 +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 7B57F1B56B for ; Sat, 27 Nov 2021 12:11:46 +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 1ARCBkK7077565 for ; Sat, 27 Nov 2021 12:11:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1ARCBkKD077564 for bugs@FreeBSD.org; Sat, 27 Nov 2021 12:11:46 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 260076] bad slot in client SEQUENCE can crash NFS server Date: Sat, 27 Nov 2021 12:11:46 +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=1638015106; 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=mHpRfD+YvY7SD4X3D/D8rdCuwH/vSWYbDeodXgMQQbY=; b=nRV8t6TRjElqBtMd2d0MVQ6/36klX1cDD+BrMW7K+OcgjAf6QhPua3fIQcuSzWuShdSk6q 8NKf8bqpTKYvBln58qL4EJ11wXLq4p/9Q/+SLgzQYvwuonjxltbZ0wUPhzITzMvl5X/8zL chzUpkVzOL5nt8J3WKgThprmf+pD16CApaYxX0wA8t9Vkl9dhGNoJmxcqiLFK4GwPb/kFq XT8UTG88ClFswQVomHA1OHetXfcxHn6mORDCj5vITs3v2K9cxCeyJGLcSCtn9AtPEvxCoX zbtnmgQy0SdlcoRGxc/d5AYi2tCUtqfRXR6HAzRarDpMZWZvh7s7eFNuZtf0cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638015106; a=rsa-sha256; cv=none; b=Jfm3V5NSa/wgLGT8pdzad5GWLAqxd1BgvNuGPtzOrqrim26Z0+b2F0CEr10a45EbB5AxV1 +7YsztMGbRyHamzZ8zZxhIjKY9Vx7KQXPQO1B8WGH3JNsW7g2WYWEB5qfsVYJckBh2C+JB 1E3/h4HDd+5tapUuYahmUQuxqQ8iWYw6pnFZf7e/oKMLUBlFL7obSzD6LNlcmEqESLue19 yS/Rc/XWnh5/pGpteE8AQ5+Mif0iKZH2fc+vP0g5SGKMXC2rWPlDbv6GqIkUdpAmC+BICB LKCYh+o1Y6cy9imIkzL/yEqLVOSl9PWXjvtXbgM3HmQpqOG+om07AeTkiC4nAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260076 Bug ID: 260076 Summary: bad slot in client SEQUENCE can crash NFS 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 #229757 text/plain mime type: Created attachment 229757 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229757&action= =3Dedit An NFS client that crashes the server with a bad slotid. nfsrvd_sequence() accepts the client's slotid without checking against 0..64: nd->nd_slotid =3D fxdr_unsigned(uint32_t, *tl++); This can cause a crash when nd_slotid is later used to index into sess_slots. I've attached a demo: # uname -a FreeBSD 14.0-CURRENT FreeBSD 14.0-CURRENT #107 main-n250904-c4c468281fb6-dirty: Sat Nov 27 06:21:53 EST 2021=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv # cc fnfsd_6.c # ./a.out ... panic: Fatal page fault at 0xffffffc000317a82: 0x4000000000000000 --- exception 13, tval =3D 0x4000000000000000 m_free() at m_free+0x10 m_freem() at m_freem+0x22 nfsv4_seqsess_cacherep() at nfsv4_seqsess_cacherep+0x56 nfsrv_cache_session() at nfsrv_cache_session+0x114 nfssvc_program() at nfssvc_program+0x624 svc_run_internal() at svc_run_internal+0x808 svc_thread_start() at svc_thread_start+0xe fork_exit() at fork_exit+0x68 fork_trampoline() at fork_trampoline+0xa --=20 You are receiving this mail because: You are the assignee for the bug.=