<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/kern/subr_time.c, branch trunk</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>clock_gettime(2): Fix CLOCK_PROCESS/THREAD_CPUTIME_ID.</title>
<updated>2023-07-08T20:02:10+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-07-08T20:02:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=d731d091e3765a540a7260d6d7f07f517d16f37b'/>
<id>d731d091e3765a540a7260d6d7f07f517d16f37b</id>
<content type='text'>
Use same calculation as getrusage, not some ad-hoc arithmetic of
internal scheduler parameters that are periodically rewound.

PR kern/57512

XXX pullup-8
XXX pullup-9
XXX pullup-10</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use same calculation as getrusage, not some ad-hoc arithmetic of
internal scheduler parameters that are periodically rewound.

PR kern/57512

XXX pullup-8
XXX pullup-9
XXX pullup-10</pre>
</div>
</content>
</entry>
<entry>
<title>White space fix.</title>
<updated>2023-04-29T03:36:55+00:00</updated>
<author>
<name>isaki</name>
<email>isaki@NetBSD.org</email>
</author>
<published>2023-04-29T03:36:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=bfa5b811e3840dd32c2af2ad7b837884d19f1c84'/>
<id>bfa5b811e3840dd32c2af2ad7b837884d19f1c84</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>kern: KASSERT(A &amp;&amp; B) -&gt; KASSERT(A); KASSERT(B)</title>
<updated>2023-04-09T09:18:09+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-04-09T09:18:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=416a8a0e0fe28c6f77bd834016f657c232b70a6d'/>
<id>416a8a0e0fe28c6f77bd834016f657c232b70a6d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>kern: Avoid arithmetic overflow in gettimeleft.</title>
<updated>2022-06-28T02:04:51+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2022-06-28T02:04:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=149cd1f02f69d8925a86263d1a45c00e8f31b5e0'/>
<id>149cd1f02f69d8925a86263d1a45c00e8f31b5e0</id>
<content type='text'>
Sprinkle assertions in to verify we're monotonically counting the
time left down to zero.

Reported-by: syzbot+5f6a6329d139810dfe3c@syzkaller.appspotmail.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sprinkle assertions in to verify we're monotonically counting the
time left down to zero.

Reported-by: syzbot+5f6a6329d139810dfe3c@syzkaller.appspotmail.com</pre>
</div>
</content>
</entry>
<entry>
<title>kern: Use timespecsubok in ts2timo.</title>
<updated>2022-06-26T22:31:47+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2022-06-26T22:31:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=050d0d0e0df34098f0af46e4c7c561a4fc4bef9a'/>
<id>050d0d0e0df34098f0af46e4c7c561a4fc4bef9a</id>
<content type='text'>
Should fix arithmetic overflow.

Reported-by: syzbot+4393a753a7c787abe6e2@syzkaller.appspotmail.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Should fix arithmetic overflow.

Reported-by: syzbot+4393a753a7c787abe6e2@syzkaller.appspotmail.com</pre>
</div>
</content>
</entry>
<entry>
<title>kern: New functions timespecaddok, timespecsubok.</title>
<updated>2022-06-26T22:31:38+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2022-06-26T22:31:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=8cfba83eef4e6fd005074dd28b894a21620a788b'/>
<id>8cfba83eef4e6fd005074dd28b894a21620a788b</id>
<content type='text'>
Return false if timespecadd or timespecsub with the same arguments
would overflow (possibly in an intermediate calculation), true if OK.

Typical usage:

sys_wotsit(...)
{
	...
	if (!timespecsubok(x, y))
		return EINVAL;
	timespecub(x, y, xydelta);
	...
}</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return false if timespecadd or timespecsub with the same arguments
would overflow (possibly in an intermediate calculation), true if OK.

Typical usage:

sys_wotsit(...)
{
	...
	if (!timespecsubok(x, y))
		return EINVAL;
	timespecub(x, y, xydelta);
	...
}</pre>
</div>
</content>
</entry>
<entry>
<title>kern: Fix fencepost error in ts2timo overflow checks.</title>
<updated>2022-03-13T17:52:45+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2022-03-13T17:52:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=436b0e7a824d2740064641916b4d5343bdc62b12'/>
<id>436b0e7a824d2740064641916b4d5343bdc62b12</id>
<content type='text'>
Triggered by

clock_settime({.tv_sec=0, .tv_nsec=0})
clock_nanosleep({.tv_sec=LLONG_MIN, .tv_nsec=0})

so that, by the time we enter ts2timo (after a few nanoseconds have
passed), we end up with

tsd = {.tv_sec=0, .tv_nsec=nonzero}
ts = {.tv_sec=LLONG_MIN, .tv_nsec=0}

and the subtraction ts - tsd leads to a borrow from tv_sec.

Reported-by: syzbot+14818113e9d0b45bca64@syzkaller.appspotmail.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Triggered by

clock_settime({.tv_sec=0, .tv_nsec=0})
clock_nanosleep({.tv_sec=LLONG_MIN, .tv_nsec=0})

so that, by the time we enter ts2timo (after a few nanoseconds have
passed), we end up with

tsd = {.tv_sec=0, .tv_nsec=nonzero}
ts = {.tv_sec=LLONG_MIN, .tv_nsec=0}

and the subtraction ts - tsd leads to a borrow from tv_sec.

Reported-by: syzbot+14818113e9d0b45bca64@syzkaller.appspotmail.com</pre>
</div>
</content>
</entry>
<entry>
<title>don't opencode kauth_cred_get()</title>
<updated>2021-09-21T14:54:26+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2021-09-21T14:54:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f5dfa5630d07a0f2d06a40ca221f59fa6a486b6c'/>
<id>f5dfa5630d07a0f2d06a40ca221f59fa6a486b6c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>restore flags-as-bitmask, just in case another function is passing its</title>
<updated>2021-03-18T14:05:37+00:00</updated>
<author>
<name>nia</name>
<email>nia@NetBSD.org</email>
</author>
<published>2021-03-18T14:05:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=3d24729b75d607de6ddcece8406d47dc939771c4'/>
<id>3d24729b75d607de6ddcece8406d47dc939771c4</id>
<content type='text'>
flags here.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flags here.</pre>
</div>
</content>
</entry>
<entry>
<title>ts2timo(9): refactor TIMER_ABSTIME handling</title>
<updated>2021-03-18T14:01:18+00:00</updated>
<author>
<name>nia</name>
<email>nia@NetBSD.org</email>
</author>
<published>2021-03-18T14:01:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=45cf5c9a9bebe4f929d736f5847569597595b80c'/>
<id>45cf5c9a9bebe4f929d736f5847569597595b80c</id>
<content type='text'>
- only use *start for output of the original time.
  for clarity purposes, use the temporary variable for everything else.
- add a check for integer underflow

Reported-by: syzbot+17b5072d5ed262a966d3@syzkaller.appspotmail.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- only use *start for output of the original time.
  for clarity purposes, use the temporary variable for everything else.
- add a check for integer underflow

Reported-by: syzbot+17b5072d5ed262a966d3@syzkaller.appspotmail.com</pre>
</div>
</content>
</entry>
</feed>
