From 83ec37c85dae1d60cab15caf357a46db4f6106cf Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Tue, 21 Apr 2020 16:13:22 +0000 Subject: [PATCH] kevent32: fix the split of data into data1/data2 The current situation results in intermittent breakage if data gets split up with the sign bit set on the data1 half of it, as PAIR32TO64 will then: data1 | (data2 << 32) -> resulting in data1 getting sign-extended when it's implicitly widened and clobbering the result. AFAICT, there's no compelling reason for these to be signed. This was most exposed by flakiness in the kqueue timer tests under compat32 after the ABSTIME test got switched over to using a better clock and microseconds. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24518 --- sys/sys/event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/event.h b/sys/sys/event.h index e2e80f37946..ef1d87ada9f 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -111,7 +111,7 @@ struct kevent32 { #ifndef __amd64__ uint32_t pad0; #endif - int32_t data1, data2; + uint32_t data1, data2; uint32_t udata; /* opaque user data identifier */ #ifndef __amd64__ uint32_t pad1;