Subject: Re: CVS commit: syssrc/sys/compat/linux/common
To: None <thorpej@wasabisystems.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 03/24/2002 10:43:25
Jason R Thorpe wrote:
> You should always use them. Consider an MP system.
I'm aware of that.
However, that code does:
fp = fd_getfile(..)
if (fp->f_type == ...) {
cmd = XX;
break; /* fp pointer no longer used */
}
vp = (struct vnode *)fp->f_data;
/* fp pointer no longer used */
There already IS possible race condition between fd_getfile() and
later checks, even FILE_USE(). Note also that i.e. sys_read(),
sys_write(), sys_pread(), sys_pwrite() also check fp->f_flag (and
eventually bail out) before FILE_USE().
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-