NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.
ntp-4.2.8p15 was released on 23 June 2020. It addresses 1 medium-severity security issue in ntpd, and provides 13 non-security bugfixes over 4.2.8p13.
Are you using Autokey in production? If so, please contact Harlan - he's got some questions for you.
Fixed Sized Types and Sign Extensions
Related Items: Bug #881
, Bug #886
, Bug #2272
With the advent of 64 bit systems several problems have been encountered with the handling of fixed sizes types highlighted by incorrect sign extension for user display.
and related functions use a format string in the form
or similar when displaying integers specifying a
argument rather than the more conventional
. I believe this was done
in order to easily support larger numbers on machines where an
might be 16 bits and
were commonly larger. A typical construct might be:
fprintf(fp,"poll adjust: %ld\n", (long)ntohl(il->compliance));
is defined as returning a 32 bit unsigned quantity and this solution works well on 16 and 32 bit systems. Even if
is a signed quantity the translation via
still results in th
e correct 32 bit pattern.
On some 64 bit systems however the promotion to
will require a sign extension and we will require more care with type casting to get the correct results.
fprintf(fp,"poll adjust: %lu\n", (unsigned long)ntohl(il->compliance));
fprintf(fp,"poll adjust: %ld\n", (long)(int32_t)ntohl(il->compliance));
has highlighted that we need to be careful with the fixed size types that we use for casts such as this.
is mentioned because it recommends we convert from the variety of older integral types to C99 integral types.
A version of
returning a signed 32 bit quantity might be a solution for some of the cases but might be difficult to implement as
is often a highly optimised macro.
A macro that typecasts
just reiterates the casting problem.
Type casting using fixed size types from
Some fixed sized types are available in
which might be used
for this purpose, all be it with slightly non-standard names.
fprintf(fp,"poll adjust: %ld\n", (long)(int32)ntohl(il->compliance));
Or we could use C99 names and add these to
when they are
missing in standard system files.
- 14 Sep 2007
? It may be that the header files are a bit 'tangled' and we should add the new types to
and 'get' them via
- I haven't looked at this in a While.
- 13 Sep 2007