Actions
Bug #5919
closedflow/manager: fix unhandled division by 0 (prealloc: 0)
Affected Versions:
Effort:
Difficulty:
Label:
Description
If we set flow.prealloc to 0, this causes Suri to error out, as it's unhandled.
Updated by Juliana Fajardini Reichow over 1 year ago
- Related to Optimization #5920: investigate: check and fix unhandled divisions by 0 added
Updated by Juliana Fajardini Reichow over 1 year ago
- Status changed from In Progress to In Review
PR for review: https://github.com/OISF/suricata/pull/8614
Updated by Juliana Fajardini Reichow over 1 year ago
- Label Needs backport to 6.0 added
- Label deleted (
Needs backport)
Updated by Victor Julien over 1 year ago
Additional finding by coverity:
** CID 1524506: Integer handling issues (DIVIDE_BY_ZERO) /src/flow-manager.c: 858 in FlowManager() ________________________________________________________________________________________________________ *** CID 1524506: Integer handling issues (DIVIDE_BY_ZERO) /src/flow-manager.c: 858 in FlowManager() 852 "flow_spare_q status: %" PRIu32 "%% flows at the queue", 853 spare_pool_len, flow_config.prealloc, 854 spare_pool_len * 100 / flow_config.prealloc); 855 856 /* only if we have pruned this "emergency_recovery" percentage 857 * of flows, we will unset the emergency bit */ >>> CID 1524506: Integer handling issues (DIVIDE_BY_ZERO) >>> In expression "spare_pool_len * 100U / flow_config.prealloc", division by expression "flow_config.prealloc" which may be zero has undefined behavior. 858 if (spare_pool_len * 100 / flow_config.prealloc > flow_config.emergency_recovery) { 859 emerg_over_cnt++; 860 } else { 861 emerg_over_cnt = 0; 862 } 863
Updated by Juliana Fajardini Reichow over 1 year ago
Merged PR: https://github.com/OISF/suricata/pull/8616
Updated by Juliana Fajardini Reichow over 1 year ago
PR addressing coverity warning:
https://github.com/OISF/suricata/pull/8628
Updated by Victor Julien over 1 year ago
- Status changed from In Review to Resolved
https://github.com/OISF/suricata/pull/8635/commits/754d2803dd5f5956b7f2ae947f933ef03cf1d15b
Coverity confirmed to be happy again.
Updated by Juliana Fajardini Reichow over 1 year ago
- Status changed from Resolved to Closed
Actions