Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Dec 2021 18:52:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 260266] NFS callback RPC with negative taglen can crash client
Message-ID:  <bug-260266-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260266

            Bug ID: 260266
           Summary: NFS callback RPC with negative taglen can crash 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 #229961 text/plain
         mime type:

Created attachment 229961
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229961&action=
=3Dedit
Crash an NFS client with a callback with a bad taglen.

nfscl_docb() has a few "goto nfsmout" before it initializes retopsp,
but the code after nfsmout dereferences retopsp if taglen !=3D -1.

I've attached a demo:

# uname -a
FreeBSD  14.0-CURRENT FreeBSD 14.0-CURRENT #130
main-n250909-08e6880c1a5c-dirty: Tue Dec  7 13:30:08 EST 2021=20=20=20=20
rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM  riscv
# cc fnfs_6.c
# ./a.out
...
panic: Fatal page fault at 0xffffffc00021c200: 0000000000000000
--- exception 15, tval =3D 0
nfscl_docb() at nfscl_docb+0x1ac
nfscb_program() at nfscb_program+0xee
svc_run_internal() at svc_run_internal+0x810
svc_run() at svc_run+0x1a2
nfscbd_nfsd() at nfscbd_nfsd+0xce
nfssvc_nfscl() at nfssvc_nfscl+0x204
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-260266-227>