#
6bb132ba |
| 15-Apr-2024 |
Brooks Davis <brooks@FreeBSD.org> |
Reduce reliance on sys/sysproto.h pollution
Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.
sys/sysproto.h currently includes sys/acl.h which currently includes sys/param.h, sys
Reduce reliance on sys/sysproto.h pollution
Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.
sys/sysproto.h currently includes sys/acl.h which currently includes sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in sys/errno.h sys/malloc.h.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44465
show more ...
|
Revision tags: release/13.3.0 |
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0 |
|
#
83158c68 |
| 23-Feb-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
time: s/ppsratecheck/eventratecheck
The routine is used as a general event-limiting routine in places which have nothing to do with packets.
Provide a define to keep everything happy.
Reviewed by:
time: s/ppsratecheck/eventratecheck
The routine is used as a general event-limiting routine in places which have nothing to do with packets.
Provide a define to keep everything happy.
Reviewed by: rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38746
show more ...
|
Revision tags: release/12.4.0 |
|
#
ef221ff6 |
| 13-Jul-2022 |
Mark Johnston <markj@FreeBSD.org> |
time: Make realitexpire() local to kern_time.c
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
#
31d1b816 |
| 28-May-2022 |
Dmitry Chagin <dchagin@FreeBSD.org> |
sysent: Get rid of bogus sys/sysent.h include.
Where appropriate hide sysent.h under proper condition.
MFC after: 2 weeks
|
Revision tags: release/13.1.0 |
|
#
91e7bdcd |
| 25-Apr-2022 |
Dmitry Chagin <dchagin@FreeBSD.org> |
Add timespecvalid_interval macro and use it.
Reviewed by: jhb, imp (early rev) Differential revision: https://reviews.freebsd.org/D34848 MFC after: 2 weeks
|
#
b3191718 |
| 23-Mar-2022 |
Mark Johnston <markj@FreeBSD.org> |
setitimer: Fix exit race
We use the p_itcallout callout, interlocked by the proc lock, to schedule timeouts for the setitimer(2) system call. When a process exits, the callout must be stopped befor
setitimer: Fix exit race
We use the p_itcallout callout, interlocked by the proc lock, to schedule timeouts for the setitimer(2) system call. When a process exits, the callout must be stopped before the process struct is recycled.
Currently we attempt to stop the callout in exit1() with the call _callout_stop_safe(&p->p_itcallout, CS_EXECUTING). If this call returns 0, then we sleep in order to drain the callout. However, this happens only if the callout is not scheduled at all. If the callout thread is blocked on the proc lock, then exit1() will not block and the callout may execute after the process has fully exited, typically resulting in a panic.
I cannot see a reason to use the CS_EXECUTING flag here. Instead, use the regular callout_stop()/callout_drain() dance to halt the callout.
Reported by: ler Tested by: ler, pho MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34625
show more ...
|
#
bb53dd56 |
| 21-Mar-2022 |
firk <firk@cantconnect.ru> |
kern_tc.c/cputick2usec() (which is used to calculate cputime from cpu ticks) has some imprecision and, worse, huge timestep (about 20 minutes on 4GHz CPU) near 53.4 days of elapsed time.
kern_time.c
kern_tc.c/cputick2usec() (which is used to calculate cputime from cpu ticks) has some imprecision and, worse, huge timestep (about 20 minutes on 4GHz CPU) near 53.4 days of elapsed time.
kern_time.c/cputick2timespec() (it is used for clock_gettime() for querying process or thread consumed cpu time) Uses cputick2usec() and then needlessly converting usec to nsec, obviously losing precision even with fixed cputick2usec().
kern_time.c/kern_clock_getres() uses some weird (anyway wrong) formula for getting cputick resolution.
PR: 262215 Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D34558
show more ...
|
#
28d08dc7 |
| 15-Mar-2022 |
firk <firk@cantconnect.ru> |
clock_gettime: Fix CLOCK_THREAD_CPUTIME_ID race
Use a spinlock section instead of a critical section to synchronize with statclock(). Otherwise the CLOCK_THREAD_CPUTIME_ID clock can appear to go ba
clock_gettime: Fix CLOCK_THREAD_CPUTIME_ID race
Use a spinlock section instead of a critical section to synchronize with statclock(). Otherwise the CLOCK_THREAD_CPUTIME_ID clock can appear to go backwards.
PR: 262273 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34568
show more ...
|
#
23ba59fb |
| 27-Dec-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
itimers: strip unused bits from struct itimer and struct itimers
Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.or
itimers: strip unused bits from struct itimer and struct itimers
Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33670
show more ...
|
#
3f157084 |
| 27-Dec-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
itimers_alloc: no need to initialize its_timers array
struct itimers is allocated with M_ZERO, setting all members to NULL is tautological.
Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Fo
itimers_alloc: no need to initialize its_timers array
struct itimers is allocated with M_ZERO, setting all members to NULL is tautological.
Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33670
show more ...
|
Revision tags: release/12.3.0 |
|
#
3138392a |
| 31-Aug-2021 |
Mark Johnston <markj@FreeBSD.org> |
itimer: Serialize access to the p_itimers array
Fix the following race between itimer_proc_continue() and process exit.
itimer_proc_continue() may be called via realitexpire(), the real interval ti
itimer: Serialize access to the p_itimers array
Fix the following race between itimer_proc_continue() and process exit.
itimer_proc_continue() may be called via realitexpire(), the real interval timer. Note that exit1() drains this timer _after_ draining and freeing itimers. Moreover, itimers_exit() is called without the process lock held; it only acquires the proc lock when deleting individual itimers, so once they are drained we free p->p_itimers without any synchronization. Thus, itimer_proc_continue() may load a non-NULL p->p_itimers array and iterate over it after it has been freed.
Fix the problem by using the process lock when clearing p->p_itimers, to synchronize with itimer_proc_continue(). Formally, accesses to this field should be protected by the process lock anyway, and since the array is allocated lazily this will not incur any overhead in the common case.
Reported by: syzbot+c40aa8bf54fe333fc50b@syzkaller.appspotmail.com Reported by: syzbot+929be2f32503bbc3844f@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31759
show more ...
|
#
8b3c4231 |
| 13-May-2021 |
Mark Johnston <markj@FreeBSD.org> |
posix timers: Check for overflow when converting to ns
Disallow a time or timer period value when the conversion to nanoseconds would overflow. Otherwise it is possible to trigger a divison by zero
posix timers: Check for overflow when converting to ns
Disallow a time or timer period value when the conversion to nanoseconds would overflow. Otherwise it is possible to trigger a divison by zero in realtime_expire_l(), where we compute the number of overruns by dividing by the timer interval.
Fixes: 7995dae9 ("posix timers: Improve the overrun calculation") Reported by: syzbot+5ab360bd3d3e3c5a6e0e@syzkaller.appspotmail.com Reported by: syzbot+157b74ff493140d86eac@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30233
show more ...
|
#
5cc1d199 |
| 13-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
realtimer_expire: avoid proc lock recursion when called from itimer_proc_continue()
It is fine to drop the process lock there, process cannot exit until its timers are cleared.
Found by: syzkaller
realtimer_expire: avoid proc lock recursion when called from itimer_proc_continue()
It is fine to drop the process lock there, process cannot exit until its timers are cleared.
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 |
|
#
4d27d8d2 |
| 11-Mar-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Stop arming realtime posix process timers on suspend or terminate
Reported and reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision:
Stop arming realtime posix process timers on suspend or terminate
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 ...
|
#
dc47fdf1 |
| 05-Mar-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Stop arming periodic process timers on suspend or terminate
Reported and reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https
Stop arming periodic process timers on suspend or terminate
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 ...
|
#
7995dae9 |
| 08-Mar-2021 |
Mark Johnston <markj@FreeBSD.org> |
posix timers: Improve the overrun calculation
timer_settime(2) may be used to configure a timeout in the past. If the timer is also periodic, we also try to compute the number of timer overruns tha
posix timers: Improve the overrun calculation
timer_settime(2) may be used to configure a timeout in the past. If the timer is also periodic, we also try to compute the number of timer overruns that occurred between the initial timeout and the time at which the timer fired. This is done in a loop which iterates once per period between the initial timeout and now. If the period is small and the initial timeout was a long time ago, this loop can take forever to run, so the system is effectively DOSed.
Replace the loop with a more direct calculation of (now - initial timeout) / period to compute the number of overruns.
Reported by: syzkaller Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29093
show more ...
|
#
60d12ef9 |
| 08-Mar-2021 |
Mark Johnston <markj@FreeBSD.org> |
posix timers: Sprinkle some style fixes
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
#
8ff2b41c |
| 08-Mar-2021 |
Mark Johnston <markj@FreeBSD.org> |
posix timers: Declare unexported functions as static
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
#
e68c6191 |
| 21-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Stop using eventhandlers for itimers subsystem exec and exit hooks.
While there, do some minor cleanup for kclocks. They are only registered from kern_time.c, make registration function static. Rem
Stop using eventhandlers for itimers subsystem exec and exit hooks.
While there, do some minor cleanup for kclocks. They are only registered from kern_time.c, make registration function static. Remove event hooks, they are not used by both registered kclocks. Add some consts.
Perhaps we can stop registering kclocks at all and statically initialize them.
Reviewed by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27305
show more ...
|
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 |
|
#
618a20d4 |
| 14-Apr-2020 |
Brooks Davis <brooks@FreeBSD.org> |
Remove bogus use of useracc() in (clock_)nanosleep.
There's no point in pre-checking that we can access the user's rmtp pointer before we do it in copyout().
While here, improve style(9) compliance
Remove bogus use of useracc() in (clock_)nanosleep.
There's no point in pre-checking that we can access the user's rmtp pointer before we do it in copyout().
While here, improve style(9) compliance.
Reviewed by: imp MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24409
show more ...
|
#
bc02c18c |
| 07-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357408 through r357661.
|
#
0783b709 |
| 04-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Remove unneeded assert for curproc. Simplify.
Reported by: syzkaller by markj Sponsored by: The FreeBSD Foundation
|