Todd Lipcon has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/12149 )

Change subject: Take absolute value of ntp maxerror to avoid undefined behavior 
from negative values
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12149/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/12149/1//COMMIT_MSG@9
PS1, Line 9: The adjtimex system call returns type signed long for maxerror. If
did you see a case in practice where maxerror returns a negative value? We've 
had this code around for 4 years or so and running on a bunch of different 
kernels and NTP implementations and haven't seen this happen yet. Looking at 
the kernel source, I agree there is nothing that prevents it from getting set 
to a negative value by another adjtimex call, but I don't see how NTP could 
calculate a negative value there since it casts to unsigned before setting it 
in the loopfilter implementation:

  ntv.maxerror = (u_int32)((sys_rootdelay / 2 +
                            sys_rootdisp) * 1e6);



--
To view, visit http://gerrit.cloudera.org:8080/12149
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3fdc5807d227bb3f6f7f039239d1a9755b9a5725
Gerrit-Change-Number: 12149
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Freeman <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-Comment-Date: Thu, 03 Jan 2019 04:26:59 +0000
Gerrit-HasComments: Yes

Reply via email to