Hardware: imx6q-cubox-i ( 6 units ) After upgrading from 3.18.4 to 3.18.5, ptpd2 in slave mode was pegging at -500ppm slew rate (the max) while trying to keep the system clock in sync. On 3.18.4, the drift correction was always about -50ppm. With the following 2 commits reverted, ptpd2 is back to about a 50ppm drift correction. time: settimeofday: Validate the values of tv from usercommit 5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f upstream. Verify that the frequency value from userspace is valid and makes sense. time: adjtimex: Validate the ADJ_FREQUENCY values commit 5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f upstream. Verify that the frequency value from userspace is valid and makes sense.
Thanks for the report! Could you confirm that it is only the "time: adjtimex: Validate the ADJ_FREQUENCY values" patch that needs to be reverted? thanks -john
Created attachment 165631 [details] Patch to fix false positives on 32bit systems Can you try this patch ontop of the affected kernel to validate it resolves the issue for you?
(In reply to john stultz from comment #2) > Created attachment 165631 [details] > Patch to fix false positives on 32bit systems > > Can you try this patch ontop of the affected kernel to validate it resolves > the issue for you? Funny, I was just checking the value of (LONG_MIN / PPM_SCALE) and (LONG_MIN / PPM_SCALE) and they were evaluating to -32 and 32. :) So, yep... using LLONG gives the correct -140737488355 to 140737488355 range. Thanks for looking at this so quickly!
Oh, and just to confirm the unstated... ptpd is now able to maintain the clock.
Willing to provide a Tested-by: tag?
(In reply to john stultz from comment #5) > Willing to provide a Tested-by: tag? Sure... Tested-by: George Joseph <george.joseph@fairview5.com>
Thanks! I'll be sending the patch out later today.
Apologies for this being a bit slow to make it upstream. The patch has made it to the -tip tree, and hopefully will be submitted to Linus soon.
Backporting the patch into 3.10.67 and above solves the "adjtime: invalid argument" problem with openntpd.
Patch has been merged for awhile. Closing this out. Let me know if there are any continued issues.