<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/compat/common/vfs_syscalls_43.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>Pull up following revision(s) (requested by pgoyette in ticket #741):</title>
<updated>2020-02-27T19:00:05+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2020-02-27T19:00:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=bd929dfea7ee5889a9a75246970c0c18ddce53ea'/>
<id>bd929dfea7ee5889a9a75246970c0c18ddce53ea</id>
<content type='text'>
	sys/compat/common/vfs_syscalls_43.c: revision 1.65

Include all of the vfs syscalls in the syscall_package, not just oquota.
Should fix PR kern/55025

XXX pullup-9</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/compat/common/vfs_syscalls_43.c: revision 1.65

Include all of the vfs syscalls in the syscall_package, not just oquota.
Should fix PR kern/55025

XXX pullup-9</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>Make code look the same, in particular zero out the rest of the directory</title>
<updated>2017-12-03T15:23:30+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2017-12-03T15:23:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=fdb233736d8441f3926465fb20e641402088bea4'/>
<id>fdb233736d8441f3926465fb20e641402088bea4</id>
<content type='text'>
record.
XXX: pullup-8</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
record.
XXX: pullup-8</pre>
</div>
</content>
</entry>
<entry>
<title>Declare mountcompatnames in sys/vfs_syscalls.h to kill nested extern.</title>
<updated>2017-07-29T04:02:49+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2017-07-29T04:02:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=e8d0104618b545a82299b609a0e3149eb6c0138b'/>
<id>e8d0104618b545a82299b609a0e3149eb6c0138b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fail, don't panic, on bad dirents from file system.</title>
<updated>2017-07-28T15:34:06+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2017-07-28T15:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=a2865c499a681f83afb4787adba6ba00f8f4c118'/>
<id>a2865c499a681f83afb4787adba6ba00f8f4c118</id>
<content type='text'>
Controllable via puffs from userland.

From Ilja Van Sprundel.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Controllable via puffs from userland.

From Ilja Van Sprundel.</pre>
</div>
</content>
</entry>
<entry>
<title>convert strcpy to a bounded copy to avoid compiler warnings, although the</title>
<updated>2017-01-13T20:24:37+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2017-01-13T20:24:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=0d37618c0b5a95d2e6905f01f18db704eba60d18'/>
<id>0d37618c0b5a95d2e6905f01f18db704eba60d18</id>
<content type='text'>
reclen test prevents overflow.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
reclen test prevents overflow.</pre>
</div>
</content>
</entry>
<entry>
<title>fill in the tv_nsec parts of the converted timespec in cvtstat().</title>
<updated>2016-08-20T00:34:42+00:00</updated>
<author>
<name>mrg</name>
<email>mrg@NetBSD.org</email>
</author>
<published>2016-08-20T00:34:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=b29e4e93239c531b5b43d3cee4bca3e050b9225e'/>
<id>b29e4e93239c531b5b43d3cee4bca3e050b9225e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
