Bug 509 - USE_ZONE_STATS uses initialised memory for statistics data
USE_ZONE_STATS uses initialised memory for statistics data
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: NSD Code
3.2.x
i386 Linux
: P5 normal
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-21 14:01 CEST by Simon Arlott
Modified: 2013-12-03 13:22 CET (History)
1 user (show)

See Also:


Attachments
Patch to fix this issue (676 bytes, patch)
2013-07-21 14:01 CEST, Simon Arlott
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arlott 2013-07-21 14:01:29 CEST
Created attachment 228 [details]
Patch to fix this issue

struct nsdst in struct zone is never initialised in namedb_open, so the per-zone statistics memory uses uninitialised data.

This causes nonsense stats like this for one of my zones:
NSTATS example.com. 1374407856 TYPE0=1879729516 A=1769369458 NS=2016240996 MD=540701286 MF=959329336 CNAME=892808754 SOA=540095022 MB=1667329122 MG=1819240555 MR=1882008933 NULL=1769500530 WKS=168452461 PTR=1769238382 HINFO=540703078 MINFO=825241650 MX=808924218 TXT=1680947514 RP=976239159 AFSDB=976237618 X25=1717974118 ISDN=862283322 RT=1630681648 NSAP=1881159778 TYPE23=1769500530 SIG=757948781 KEY=1667329122 PX=1819240555 TYPE27=1919945317 AAAA=1684633199 LOC=1719151973 NXT=840972914 TYPE31=976302128 TYPE32=976238388 SRV=929313081 TYPE34=842674234 NAPTR=1715089460 KX=979789364 CERT=808674662 TYPE38=1650537018 DNAME=1818370104 TYPE40=1751868257 OPT=761621615 APL=1869770797 DS=1634560376 SSHFP=1847790090 IPSECKEY=1718187119 RRSIG=840972921 NSEC=976236641 DNSKEY=812004401 DHCID=808478010 NSEC3=976239154 NSEC3PARAM=976237618 TLSA=1717974118 TYPE53=862283322 TYPE54=1630681648 TYPE55=1881159778 TYPE56=1769500530 TYPE57=757948781 TYPE58=1667329122 TYPE59=1819240555 TYPE60=1881344613 TYPE61=1769369458 TYPE62=2016240996 TYPE63=540701286 TYPE64=808476978 TYPE65=1714696506 TYPE66=811940400 TYPE67=809120304 TYPE68=808727098 TYPE69=1714710074 TYPE70=1701198438 TYPE71=842674227 TYPE72=540566113 TYPE73=1667329122 TYPE74=1819240555 TYPE75=1882008933 TYPE76=1769500530 TYPE77=168452461 TYPE78=1987015280 TYPE79=761619561 TYPE80=980575864 TYPE81=774977568 TYPE82=808988210 TYPE83=540030766 TYPE84=1667329122 TYPE85=1819240555 TYPE86=1882008933 TYPE87=1769500530 TYPE88=680301
Comment 1 Matthijs Mekking 2013-12-03 13:22:08 CET
Thanks for your patch. Applied and committed in r4108.