From nobody Thu Dec 2 19:16:14 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 6520318B178C for ; Thu, 2 Dec 2021 19:16:16 +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 4J4lzz1Xtrz4TZ5 for ; Thu, 2 Dec 2021 19:16:15 +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 6713222D9F for ; Thu, 2 Dec 2021 19:16:14 +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 1B2JGEUS090183 for ; Thu, 2 Dec 2021 19:16:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1B2JGECS090182 for bugs@FreeBSD.org; Thu, 2 Dec 2021 19:16:14 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 260176] nfsrvd_verify() passes sfp=NULL to nfsv4_loadattr(), which can crash Date: Thu, 02 Dec 2021 19:16:14 +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=1638472575; 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=J/dXOd3s0NFnnp+rPn02fiPlJ7cpXflM4Iv5vpsqmy8=; b=WKN1mdZ4eOKp0yeODJ/r+wvfn3Of3TZR2h/Yifr/voTLvpMK7tICC+ENZ6s58KUFAE14YY FCknRGnj6suE8bHzbo2n26HATBEmsl4A/mRryQLqJh0+WJiE1bl6lu0XNC1WnH4/ZqCEo7 EMT/WYi+lINdgLQq8qGZm6y+bIoS5NeIwNZhwzu5hJLTqcG4SF6eJR/v5IZp8vbAwiV0nB Br1To5vEI2IWnWYxv8a1k9mCYCiv+AYI+KTjt2EkDY2Df9VL79hp5ORMTH2NNI1xM5zoaK epHKSlGFbEtmU2IaYbQMJ5BaipMrQMW2Xc0PWA721M+kxypqMxwJFEmtVLIJyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638472575; a=rsa-sha256; cv=none; b=xZCgJIGoz85VCrBsHgjhT1ypD4dlZ4Teo/9588SE8kIGqP4jgeEN9/DC67MdFD4EMEGs10 MMPTc+bjQXP02gvDdHAtCK8Xb5zdjNuriXdbBh5DWol9PgV+I00Zv3R3/l4t1iYeFdC/M/ SlIrbs5Q7q1hydwx68OM9ESM0ahOMsmePlNWEFRW7fdE1lTWE0bZYt9DjebWEyViXrWqrQ M33PwPRTdRBhS4vGvs4smzommosLUOQwGhmkLNXK0qhoGMdP1JNobHSejJAlsRL0MHeeo3 gjkxuHaHnzZpBv0UYikZIkZu9pylG75BtG7YDdgcrsmb/dN1YVe0WaXqUy+3BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260176 Bug ID: 260176 Summary: nfsrvd_verify() passes sfp=3DNULL to nfsv4_loadattr(), which can crash 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 #229846 text/plain mime type: Created attachment 229846 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229846&action= =3Dedit Crash an NFS v4 server with a VERIFY that mentions FILESAVAIL nfsrvd_verify() passes NULL for sfp to nfsv4_loadattr(), but if the client includes an attribute like FILESAVAIL that uses sfp, nfsv4_loadattr() will crash. I've attached a demo: # uname -a FreeBSD 14.0-CURRENT FreeBSD 14.0-CURRENT #122 main-n250906-d95bc6b0bf4c-dirty: Thu Dec 2 05:26:06 EST 2021=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv # cc fnfsd_9.c # ./a.out ... panic: Fatal page fault at 0xffffffc00020a678: 0x00000000000028 --- exception 13, tval =3D 0x28 nfsv4_loadattr() at nfsv4_loadattr+0x1a94 nfsrvd_verify() at nfsrvd_verify+0xb6 nfsrvd_dorpc() at nfsrvd_dorpc+0x147a nfssvc_program() at nfssvc_program+0x5a8 svc_run_internal() at svc_run_internal+0x810 svc_run() at svc_run+0x1a2 nfsrvd_nfsd() at nfsrvd_nfsd+0x30c nfssvc_nfsd() at nfssvc_nfsd+0x3ac sys_nfssvc() at sys_nfssvc+0xd0 do_trap_user() at do_trap_user+0x220 cpu_exception_handler_user() at cpu_exception_handler_user+0x72 --=20 You are receiving this mail because: You are the assignee for the bug.=