<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/compat/common/vfs_syscalls_30.c, branch lockcount-9.3</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>Pull up following revision(s), all via patch</title>
<updated>2022-08-03T11:11:31+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T11:11:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=c0cbb295300c06ff7945a8867c3b48a4e30dcb6c'/>
<id>c0cbb295300c06ff7945a8867c3b48a4e30dcb6c</id>
<content type='text'>
(requested by riastradh in ticket #1487):

	sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
	sys/compat/sunos/sunos_misc.c: revision 1.177
	sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
	sys/compat/common/kern_resource_43.c: revision 1.23
	sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
	sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
	sys/compat/common/vfs_syscalls_12.c: revision 1.38
	sys/compat/ultrix/ultrix_misc.c: revision 1.126
	sys/compat/common/kern_sig_43.c: revision 1.37
	sys/compat/linux/common/linux_mtio.c: revision 1.8
	sys/compat/freebsd/freebsd_misc.c: revision 1.34
	sys/compat/freebsd/freebsd_machdep.c: revision 1.5
	sys/compat/linux/common/linux_olduname.c: revision 1.67
	sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
	sys/compat/freebsd/freebsd_sched.c: revision 1.23
	sys/compat/ossaudio/ossaudio.c: revision 1.84
	sys/compat/sys/time_types.h: revision 1.6
	sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
	sys/compat/common/ieee80211_20.c: revision 1.7
	sys/compat/linux/common/linux_file.c: revision 1.119
	sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
	sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
	sys/compat/linux32/common/linux32_time.c: revision 1.38
	sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
	sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
	sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
	sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
	sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
	sys/compat/linux/common/linux_misc.c: revision 1.252
	sys/compat/linux/common/linux_hdio.c: revision 1.19
	sys/compat/sunos/sunos_ioctl.c: revision 1.71
	sys/compat/linux/common/linux_sched.c: revision 1.79
	sys/compat/common/kern_info_43.c: revision 1.40
	sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
	sys/compat/linux/common/linux_socket.c: revision 1.153
	sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
	sys/compat/common/vfs_syscalls_43.c: revision 1.68
	sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
	sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
	sys/compat/common/kern_time_50.c: revision 1.37
	sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
	sys/compat/linux/common/linux_cdrom.c: revision 1.28
	sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
	sys/compat/common/kern_info_09.c: revision 1.22
	sys/compat/linux32/common/linux32_resource.c: revision 1.12
	sys/compat/linux/common/linux_oldolduname.c: revision 1.67
	sys/compat/common/if_media_80.c: revision 1.4
	sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
	sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
	sys/compat/linux32/common/linux32_signal.c: revision 1.21
	sys/compat/common/kern_sig_13.c: revision 1.22
	sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
	sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
	sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
	sys/compat/netbsd32/netbsd32_time.c: revision 1.56
	sys/compat/linux/common/linux_signal.c: revision 1.84
	sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
	sys/compat/sunos32/sunos32_misc.c: revision 1.85
	sys/compat/linux/common/linux_time.c: revision 1.40
	sys/compat/linux/common/linux_fdio.c: revision 1.14
	sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure.  If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(requested by riastradh in ticket #1487):

	sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
	sys/compat/sunos/sunos_misc.c: revision 1.177
	sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
	sys/compat/common/kern_resource_43.c: revision 1.23
	sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
	sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
	sys/compat/common/vfs_syscalls_12.c: revision 1.38
	sys/compat/ultrix/ultrix_misc.c: revision 1.126
	sys/compat/common/kern_sig_43.c: revision 1.37
	sys/compat/linux/common/linux_mtio.c: revision 1.8
	sys/compat/freebsd/freebsd_misc.c: revision 1.34
	sys/compat/freebsd/freebsd_machdep.c: revision 1.5
	sys/compat/linux/common/linux_olduname.c: revision 1.67
	sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
	sys/compat/freebsd/freebsd_sched.c: revision 1.23
	sys/compat/ossaudio/ossaudio.c: revision 1.84
	sys/compat/sys/time_types.h: revision 1.6
	sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
	sys/compat/common/ieee80211_20.c: revision 1.7
	sys/compat/linux/common/linux_file.c: revision 1.119
	sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
	sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
	sys/compat/linux32/common/linux32_time.c: revision 1.38
	sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
	sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
	sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
	sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
	sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
	sys/compat/linux/common/linux_misc.c: revision 1.252
	sys/compat/linux/common/linux_hdio.c: revision 1.19
	sys/compat/sunos/sunos_ioctl.c: revision 1.71
	sys/compat/linux/common/linux_sched.c: revision 1.79
	sys/compat/common/kern_info_43.c: revision 1.40
	sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
	sys/compat/linux/common/linux_socket.c: revision 1.153
	sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
	sys/compat/common/vfs_syscalls_43.c: revision 1.68
	sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
	sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
	sys/compat/common/kern_time_50.c: revision 1.37
	sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
	sys/compat/linux/common/linux_cdrom.c: revision 1.28
	sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
	sys/compat/common/kern_info_09.c: revision 1.22
	sys/compat/linux32/common/linux32_resource.c: revision 1.12
	sys/compat/linux/common/linux_oldolduname.c: revision 1.67
	sys/compat/common/if_media_80.c: revision 1.4
	sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
	sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
	sys/compat/linux32/common/linux32_signal.c: revision 1.21
	sys/compat/common/kern_sig_13.c: revision 1.22
	sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
	sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
	sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
	sys/compat/netbsd32/netbsd32_time.c: revision 1.56
	sys/compat/linux/common/linux_signal.c: revision 1.84
	sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
	sys/compat/sunos32/sunos32_misc.c: revision 1.85
	sys/compat/linux/common/linux_time.c: revision 1.40
	sys/compat/linux/common/linux_fdio.c: revision 1.14
	sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure.  If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by christos in ticket #1337):</title>
<updated>2021-08-15T09:27:50+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2021-08-15T09:27:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=09e381d72d01a774e226aa05a00134738f7c0ff5'/>
<id>09e381d72d01a774e226aa05a00134738f7c0ff5</id>
<content type='text'>
	sys/compat/common/vfs_syscalls_43.c: revision 1.67
	sys/compat/common/vfs_syscalls_50.c: revision 1.26
	sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/compat/common/vfs_syscalls_43.c: revision 1.67
	sys/compat/common/vfs_syscalls_50.c: revision 1.26
	sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions</pre>
</div>
</content>
</entry>
<entry>
<title>Merge the [pgoyette-compat] branch</title>
<updated>2019-01-27T02:08:33+00:00</updated>
<author>
<name>pgoyette</name>
<email>pgoyette@NetBSD.org</email>
</author>
<published>2019-01-27T02:08:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=cc17ee2ece085d7d746bcd8fa9be19170855aaac'/>
<id>cc17ee2ece085d7d746bcd8fa9be19170855aaac</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename min/max -&gt; uimin/uimax for better honesty.</title>
<updated>2018-09-03T16:29:22+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2018-09-03T16:29:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=a8a5c538b6388ff28a5944a8f637db644ee9a623'/>
<id>a8a5c538b6388ff28a5944a8f637db644ee9a623</id>
<content type='text'>
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) &lt; (b) ? (a) : (b))
	#define max(a, b)	((a) &gt; (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) &lt; (b) ? (a) : (b))
	#define max(a, b)	((a) &gt; (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)</pre>
</div>
</content>
</entry>
<entry>
<title>simplify</title>
<updated>2014-10-20T11:58:01+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2014-10-20T11:58:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=a299e53ddee473b51024ab8dfed002f17627bebe'/>
<id>a299e53ddee473b51024ab8dfed002f17627bebe</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Memory leak, triggerable from root only.</title>
<updated>2014-10-20T06:56:38+00:00</updated>
<author>
<name>maxv</name>
<email>maxv@NetBSD.org</email>
</author>
<published>2014-10-20T06:56:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=cba50ac9822e1b9b91a97a6625167e8b19cdf451'/>
<id>cba50ac9822e1b9b91a97a6625167e8b19cdf451</id>
<content type='text'>
Found by my code scanner.

ok christos@</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found by my code scanner.

ok christos@</pre>
</div>
</content>
</entry>
<entry>
<title>Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get</title>
<updated>2014-09-05T09:20:59+00:00</updated>
<author>
<name>matt</name>
<email>matt@NetBSD.org</email>
</author>
<published>2014-09-05T09:20:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=11a55f5b084ab333fdc7e1df943575912d882fbe'/>
<id>11a55f5b084ab333fdc7e1df943575912d882fbe</id>
<content type='text'>
a correctly typed pointer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
a correctly typed pointer.</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce struct pathbuf. This is an abstraction to hold a pathname</title>
<updated>2010-11-19T06:44:33+00:00</updated>
<author>
<name>dholland</name>
<email>dholland@NetBSD.org</email>
</author>
<published>2010-11-19T06:44:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=8f6ed30d57969451cf6dee44963bdbfad19bea01'/>
<id>8f6ed30d57969451cf6dee44963bdbfad19bea01</id>
<content type='text'>
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up vnode lock operations pass 2:</title>
<updated>2010-06-24T12:58:48+00:00</updated>
<author>
<name>hannken</name>
<email>hannken@NetBSD.org</email>
</author>
<published>2010-06-24T12:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=1423e65b26cfa3a30fb7aaea6d57132588c43746'/>
<id>1423e65b26cfa3a30fb7aaea6d57132588c43746</id>
<content type='text'>
VOP_UNLOCK(vp, flags) -&gt; VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
VOP_UNLOCK(vp, flags) -&gt; VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.</pre>
</div>
</content>
</entry>
<entry>
<title>When implementing "read directory", when there are too many empty entries</title>
<updated>2010-03-03T08:20:38+00:00</updated>
<author>
<name>he</name>
<email>he@NetBSD.org</email>
</author>
<published>2010-03-03T08:20:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=7a30544200f0e33f9bc1ebd2606c29d7ed58b792'/>
<id>7a30544200f0e33f9bc1ebd2606c29d7ed58b792</id>
<content type='text'>
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.</pre>
</div>
</content>
</entry>
</feed>
