diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-01-08 22:33:14 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-01-08 22:33:14 +0000 |
commit | 41ce5ae6b1aa881b5cfdd5b2b1e0a6afcda26b19 (patch) | |
tree | e60fd8bf80d5ba8c68f29e75cfec4e0fbad545a6 /sys/kern/sys_futex.c | |
parent | cc6df18ad7ba54ddc91818afc2b820f734661ffd (diff) |
Do not pass a userland pointer to ktrabstimespec().
Prevents an infinite pagefault/pmap_enter() loop when ktracing apps
doing a lot of futex(2) calls like firefox & chrome.
Diffstat (limited to 'sys/kern/sys_futex.c')
-rw-r--r-- | sys/kern/sys_futex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_futex.c b/sys/kern/sys_futex.c index 9d00d0f46d9..a31dfdd41a5 100644 --- a/sys/kern/sys_futex.c +++ b/sys/kern/sys_futex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_futex.c,v 1.5 2017/12/19 16:41:43 deraadt Exp $ */ +/* $OpenBSD: sys_futex.c,v 1.6 2018/01/08 22:33:13 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -212,7 +212,7 @@ futex_wait(uint32_t *uaddr, uint32_t val, const struct timespec *timeout) return error; #ifdef KTRACE if (KTRPOINT(p, KTR_STRUCT)) - ktrabstimespec(p, timeout); + ktrabstimespec(p, &ts); #endif to_ticks = (uint64_t)hz * ts.tv_sec + (ts.tv_nsec + tick * 1000 - 1) / (tick * 1000) + 1; |