#
9c999a25 |
| 29-Sep-2021 |
Kyle Evans <kevans@FreeBSD.org> |
kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME
NOTE_ABSTIME values are converted to values relative to boottime in filt_timervalidate(), and negative values are currently rejec
kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME
NOTE_ABSTIME values are converted to values relative to boottime in filt_timervalidate(), and negative values are currently rejected. We don't reject times in the past in general, so clamp this up to 0 as needed such that the timer fires immediately rather than imposing what looks like an arbitrary restriction.
Another possible scenario is that the system clock had to be adjusted by ~minutes or ~hours and we have less than that in terms of uptime, making a reasonable short-timeout suddenly invalid. Firing it is still a valid choice in this scenario so that applications can at least expect a consistent behavior.
Reviewed by: kib, markj Discussed with: allanjude Differential Revision: https://reviews.freebsd.org/D32230
show more ...
|
#
0321a799 |
| 24-Sep-2021 |
Nathaniel Wesley Filardo <nfilardo@microsoft.com> |
kqueue: Add EV_KEEPUDATA flag
When this flag is set, operations that update an existing kevent will not change the udata field. This can be used to NOTE_TRIGGER or EV_{EN,DIS}ABLE events without ov
kqueue: Add EV_KEEPUDATA flag
When this flag is set, operations that update an existing kevent will not change the udata field. This can be used to NOTE_TRIGGER or EV_{EN,DIS}ABLE events without overwriting the stashed pointer.
Reviewed by: Domagoj Stolfa <domagoj.stolfa@gmail.com> Obtained from: CheriBSD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D30286
show more ...
|
#
98168a6e |
| 06-Sep-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
kqueue: drain kqueue taskqueue if syscall tickled it
Otherwise return from the syscall and next syscall, which could be kevent(2) on the kqueue that should be notified, races with the kqueue taskque
kqueue: drain kqueue taskqueue if syscall tickled it
Otherwise return from the syscall and next syscall, which could be kevent(2) on the kqueue that should be notified, races with the kqueue taskqueue thread, and potentially misses the wakeup. This is reliably visible when kevent(2) only peeks into events using zeroed timeout.
PR: 258310 Reported by: arichardson, Jan Kokemüller <jan.kokemueller@gmail.com> Reviewed by: arichardson, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31858
show more ...
|
#
c511383d |
| 01-Sep-2021 |
Mark Johnston <markj@FreeBSD.org> |
kevent: Fix races between timer detach and kqtimer_proc_continue()
- When detaching a knote, we need to double check the enqueued flag after acquiring the process lock, as kqtimer_proc_continue()
kevent: Fix races between timer detach and kqtimer_proc_continue()
- When detaching a knote, we need to double check the enqueued flag after acquiring the process lock, as kqtimer_proc_continue() may have toggled it. - kqtimer_proc_continue() could in principle reschedule a stopped callout after filt_timerdetach() drains the callout. So, we need to re-check.
Reported by: syzbot+4a4cebb3ec07892cb040@syzkaller.appspotmail.com Reported by: syzbot+a9c04bc76078a3b7dd8d@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31772
show more ...
|
#
c9f8dcda |
| 02-Jun-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
kqueue: replace kq_ncallouts loop with atomic_fetchadd
|
#
e00bae5c |
| 27-May-2021 |
Mark Johnston <markj@FreeBSD.org> |
kevent: Prohibit negative change and event list lengths
Previously, a negative change list length would be treated the same as an empty change list. A negative event list length would result in bog
kevent: Prohibit negative change and event list lengths
Previously, a negative change list length would be treated the same as an empty change list. A negative event list length would result in bogus copyouts. Make kevent(2) return EINVAL for both cases so that application bugs are more easily found, and to be more robust against future changes to kevent internals.
Reviewed by: imp, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30480
show more ...
|
#
2cca77ee |
| 14-May-2021 |
Mark Johnston <markj@FreeBSD.org> |
kqueue timer: Remove detached knotes from the process stop queue
There are some scenarios where a timer event may be detached when it is on the process' kqueue timer stop queue. If kqtimer_proc_con
kqueue timer: Remove detached knotes from the process stop queue
There are some scenarios where a timer event may be detached when it is on the process' kqueue timer stop queue. If kqtimer_proc_continue() is called after that point, it will iterate over the queue and access freed timer structures.
It is also possible, at least in a multithreaded program, for a stopped timer event to be scheduled without removing it from the process' stop queue. Ensure that we do not doubly enqueue the event structure in this case.
Reported by: syzbot+cea0931bb4e34cd728bd@syzkaller.appspotmail.com Reported by: syzbot+9e1a2f3734652015998c@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30251
show more ...
|
#
7cb40543 |
| 28-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
filt_timerexpire: do not iterate over the interval
User-supplied data might make this loop too time-consuming. Divide directly, and handle both the possibility that we were woken up earlier, and ari
filt_timerexpire: do not iterate over the interval
User-supplied data might make this loop too time-consuming. Divide directly, and handle both the possibility that we were woken up earlier, and arithmetic overflows/underflows from the calculation.
Reported and tested by: pho (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30069
show more ...
|
#
f1f98706 |
| 18-Apr-2021 |
Warner Losh <imp@FreeBSD.org> |
Minor style cleanup
We prefer 'while (0)' to 'while(0)' according to grep and stlye(9)'s space after keyword rule. Remove a few stragglers of the latter. Many of these usages were inconsistent withi
Minor style cleanup
We prefer 'while (0)' to 'while(0)' according to grep and stlye(9)'s space after keyword rule. Remove a few stragglers of the latter. Many of these usages were inconsistent within the file.
MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
75c5cf7a |
| 13-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
filt_timerexpire: avoid process lock recursion
Found by: syzkaller Reported and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freeb
filt_timerexpire: avoid process lock recursion
Found by: syzkaller Reported and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29746
show more ...
|
Revision tags: release/13.0.0 |
|
#
2fd1ffef |
| 06-Mar-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Stop arming kqueue timers on knote owner suspend or terminate
This way, even if the process specified very tight reschedule intervals, it should be stoppable/killable.
Reported and reviewed by: mar
Stop arming kqueue timers on knote owner suspend or terminate
This way, even if the process specified very tight reschedule intervals, it should be stoppable/killable.
Reported and reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29106
show more ...
|
#
533e5057 |
| 06-Mar-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Add helper for kqueue timers callout scheduling
Reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D2
Add helper for kqueue timers callout scheduling
Reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29106
show more ...
|
#
6b3a9a0f |
| 12-Jan-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
Convert remaining cap_rights_init users to cap_rights_init_one
semantic patch:
@@
expression rights, r;
@@
- cap_rights_init(&rights, r) + cap_rights_init_one(&rights, r)
|
#
4d0c33be |
| 09-Jan-2021 |
Jan Kokemüller <jan.kokemueller@gmail.com> |
kevent(2): Bugfix for wrong EVFILT_TIMER timeouts
When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be used instead of NS_TO_SBT, otherwise the timeout results are misleading.
PR: 25
kevent(2): Bugfix for wrong EVFILT_TIMER timeouts
When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be used instead of NS_TO_SBT, otherwise the timeout results are misleading.
PR: 252539 Reviewed by: kevans, kib Approved by: kevans MFC after: 3 weeks
show more ...
|
#
e90afaa0 |
| 09-Nov-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
kqueue: save space by using only one func pointer for assertions
|
Revision tags: release/12.2.0 |
|
#
6fed89b1 |
| 02-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
kern: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
59dafcde |
| 21-Apr-2020 |
Kyle Evans <kevans@FreeBSD.org> |
kqueue: fix conversion of timer data to sbintime
This unbreaks the i386 kqueue timer tests after a recent change switched NOTE_ABSTIME over to using microseconds. Notably, the data argument (which h
kqueue: fix conversion of timer data to sbintime
This unbreaks the i386 kqueue timer tests after a recent change switched NOTE_ABSTIME over to using microseconds. Notably, the data argument (which holds useconds) is an int64_t, but we were passing it to timer2sbintime which takes an intptr_t. Perhaps in a previous incarnation, intptr_t would have made sense, but now it just leads to the timestamp getting truncated and subsequently rejected when it no longer fits in an intptr_t.
PR: 245768 Reported by: lwhsu / CI MFC after: 1 week
show more ...
|
#
dca7f66f |
| 15-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357931 through r357965.
|
#
445faddf |
| 15-Feb-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
kqueue: use new capsicum helpers
|
Revision tags: release/12.1.0 |
|
#
58df81b3 |
| 30-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @350426
Sponsored by: The FreeBSD Foundation
|
#
91898857 |
| 29-Jul-2019 |
Mark Johnston <markj@FreeBSD.org> |
Avoid relying on header pollution from sys/refcount.h.
MFC after: 3 days Sponsored by: The FreeBSD Foundation
|
Revision tags: release/11.3.0 |
|
#
67350cb5 |
| 09-Dec-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340918 through r341763.
|
#
e52327e3 |
| 08-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: postpone proc unlock until after reporting with kqueue
kqueue would always relock immediately afterwards.
While here drop the NULL check for list itself. The list is always allocated.
Sponso
proc: postpone proc unlock until after reporting with kqueue
kqueue would always relock immediately afterwards.
While here drop the NULL check for list itself. The list is always allocated.
Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/12.0.0 |
|
#
c1532e70 |
| 25-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340869 through r340917.
|
#
792843c3 |
| 24-Nov-2018 |
Mark Johnston <markj@FreeBSD.org> |
Pass malloc flags directly through kevent(2) subroutines.
Some kevent functions have a boolean "waitok" parameter for use when calling malloc(9). Replace them with the corresponding malloc() flags:
Pass malloc flags directly through kevent(2) subroutines.
Some kevent functions have a boolean "waitok" parameter for use when calling malloc(9). Replace them with the corresponding malloc() flags: the desired behaviour is known at compile-time, so this eliminates a couple of conditional branches, and makes the code easier to read.
No functional change intended.
Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18318
show more ...
|