[ZBX-11781] Potential overflow/underflow in housekeeper Created: 2017 Feb 07  Updated: 2024 Apr 10  Resolved: 2017 Feb 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Server (S)
Affects Version/s: 2.2.17rc1, 3.0.8rc1, 3.2.4rc1, 3.4.0alpha1
Fix Version/s: 2.2.17rc1, 3.0.8rc1, 3.2.4rc1, 3.4.0alpha1

Type: Incident report Priority: Trivial
Reporter: Glebs Ivanovskis (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: overflow
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Team: Team A
Sprint: Sprint 1

 Description   

It is possible to set History/Trend storage period to 65535 and use even greater numbers in global housekeeping settings which will cause problems here:

keep_from = now - *rule->phistory * SEC_PER_DAY;


 Comments   
Comment by Andrea Biscuola (Inactive) [ 2017 Feb 08 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-11781

Comment by dimir [ 2017 Feb 14 ]

(1) [S] Overflow/underflow still possible with big history number (the reason being that when multiplying 2 int types the result is int):

if (history * SEC_PER_DAY > now)
Trends storage period resulting keep_from resulting Date
365 1455551313 Mon Feb 15 17:48:33 EET 2016
10000 623087313 Fri Sep 29 17:48:33 EET 1989
20000 0 Thu Jan 1 03:00:00 MSK 1970
30000 -1104912687 Thu Dec 27 17:48:33 EET 1934

abs As me and dimir suspected, the checks for the multiplication was not enough for the overflow. Resolved in r65697

sasha CLOSED

Comment by Andrea Biscuola (Inactive) [ 2017 Feb 16 ]

Fixed in:

  • 2.2.17rc1
  • 3.0.8rc1
  • 3.2.4rc1
  • 3.3.0 (trunk)
Generated at Thu Apr 18 18:08:13 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.