kern/185232: Kernel page fault in jailed() via vn_stat() when using uio_td from nfsrv_read()

Greg Becker beckerg at netapp.com
Fri Dec 27 16:20:01 UTC 2013


>Number:         185232
>Category:       kern
>Synopsis:       Kernel page fault in jailed() via vn_stat() when using uio_td from nfsrv_read()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 27 16:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Greg Becker
>Release:        9.2
>Organization:
NetApp
>Environment:
FreeBSD perf-filer-1.stl.netapp.com 9.2-STABLE FreeBSD 9.2-STABLE #69 r259677M: Fri Dec 27 06:15:18 CST 2013     beckerg at perf-filer-1.stl.netapp.com:/usr/obj/usr/src/sys/PERFFILER1  amd64
>Description:
I'm using a custom nullfs that calls vn_stat() from my null_read() function.  The problem is, nfsrv_read() doesn't set uio_td, so my null_read() function gets whatever was on the caller's stack.
>How-To-Repeat:

>Fix:
Either don't use uio_td when being called from nfssrv_read(), or set uio_td to NULL in nfssrv_read().


Patch attached with submission follows:

Index: sys/nfsserver/nfs_serv.c
===================================================================
--- sys/nfsserver/nfs_serv.c	(revision 259677)
+++ sys/nfsserver/nfs_serv.c	(working copy)
@@ -965,6 +965,7 @@
 		uiop->uio_resid = len;
 		uiop->uio_rw = UIO_READ;
 		uiop->uio_segflg = UIO_SYSSPACE;
+		uiop->uio_td = NULL;
 		nh = nfsrv_sequential_heuristic(uiop, vp);
 		ioflag |= nh->nh_seqcount << IO_SEQSHIFT;
 		error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred);


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list