NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/47226: KASSERT while running t_faccessat on tmpfs mount
The following reply was made to PR kern/47226; it has been noted by GNATS.
From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/47226: KASSERT while running t_faccessat on tmpfs mount
Date: Wed, 21 Nov 2012 19:39:27 +0100
--Apple-Mail=_A72DD895-6759-4925-9D1F-D9E3B2750077
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Both fd_nameiat() and fd_nameiat_simple() call VOP_ACCESS() on
an unlocked vnode which is wrong.
The untested diff attached could fix it.
--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
(Germany)
--Apple-Mail=_A72DD895-6759-4925-9D1F-D9E3B2750077
Content-Disposition: attachment;
filename=diff.txt
Content-Type: text/plain;
x-unix-mode=0644;
name="diff.txt"
Content-Transfer-Encoding: 7bit
Index: vfs_syscalls.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.461
diff -p -u -2 -r1.461 vfs_syscalls.c
--- vfs_syscalls.c 19 Nov 2012 15:01:17 -0000 1.461
+++ vfs_syscalls.c 21 Nov 2012 18:40:17 -0000
@@ -183,5 +183,7 @@ fd_nameiat(struct lwp *l, int fdat, stru
if (!(dfp->f_flag & FSEARCH)) {
+ vn_lock(dfp->f_data, LK_EXCLUSIVE);
error = VOP_ACCESS(dfp->f_data, VEXEC, l->l_cred);
+ VOP_UNLOCK(dfp->f_data);
if (error)
goto cleanup;
@@ -213,5 +215,7 @@ fd_nameiat_simple_user(struct lwp *l, in
if (!(dfp->f_flag & FSEARCH)) {
+ vn_lock(dfp->f_data, LK_EXCLUSIVE);
error = VOP_ACCESS(dfp->f_data, VEXEC, l->l_cred);
+ VOP_UNLOCK(dfp->f_data);
if (error)
goto cleanup;
--Apple-Mail=_A72DD895-6759-4925-9D1F-D9E3B2750077--
Home |
Main Index |
Thread Index |
Old Index