Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Dec 2013 16:13:42 GMT
From:      Greg Becker <beckerg@netapp.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/185232: Kernel page fault in jailed() via vn_stat() when using uio_td from nfsrv_read()
Message-ID:  <201312271613.rBRGDgN8068938@oldred.freebsd.org>
Resent-Message-ID: <201312271620.rBRGK0bc069811@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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