Project

General

Profile

Actions

Bug #8146

closed
SZ SZ

utils-spm-hs: missing deallocators on hs_compile failure

Bug #8146: utils-spm-hs: missing deallocators on hs_compile failure

Added by Sergey Zhidkih 4 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
low
Difficulty:
Label:

Description

During fuzzing siginit discovered two minor memory leaks in HSBuildDatabase which is caused by missing deallocators when Hyperscan fails to compile expression.

The problem is missing deallocator for expression and missing deallocator for Hyperscan error.

char *expr = HSRenderPattern(needle, needle_len);

hs_error_t err = hs_compile(expr, flags, HS_MODE_BLOCK, NULL, &db,
                             &compile_err);
if (err != HS_SUCCESS) {
    SCLogError("Unable to compile '%s' with Hyperscan, " 
               "returned %d.",
            expr, err);
    return -1;
}

SCFree(expr);


Subtasks 2 (0 open2 closed)

Bug #8167: utils-spm-hs: missing deallocators on hs_compile failure (8.0.x backport)ClosedSergey ZhidkihActions
Bug #8168: utils-spm-hs: missing deallocators on hs_compile failure (7.0.x backport)ClosedSergey ZhidkihActions

Related issues 1 (1 open0 closed)

Blocks Suricata - Security #6187: detect: handle allocation failures during rule reloadIn ProgressPhilippe AntoineActions

SZ Updated by Sergey Zhidkih 4 months ago Actions #1

May I claim this issue and get developer role?

VJ Updated by Victor Julien 4 months ago Actions #2

  • Status changed from New to Assigned
  • Assignee set to Sergey Zhidkih
  • Target version changed from TBD to 9.0.0-beta1

Thanks for looking into this. We'd need a Github PR against the main branch. After merge we probably want to backport as well.

PA Updated by Philippe Antoine 4 months ago Actions #3

  • Status changed from Assigned to In Review

PA Updated by Philippe Antoine 4 months ago Actions #4

  • Blocks Security #6187: detect: handle allocation failures during rule reload added

VJ Updated by Victor Julien 4 months ago Actions #5

  • Label Needs backport to 7.0, Needs backport to 8.0 added

OT Updated by OISF Ticketbot 4 months ago Actions #6

  • Subtask #8167 added

OT Updated by OISF Ticketbot 4 months ago Actions #7

  • Label deleted (Needs backport to 8.0)

OT Updated by OISF Ticketbot 4 months ago Actions #8

  • Subtask #8168 added

OT Updated by OISF Ticketbot 4 months ago Actions #9

  • Label deleted (Needs backport to 7.0)

PA Updated by Philippe Antoine 3 months ago Actions #10

  • Status changed from In Review to Resolved

PA Updated by Philippe Antoine about 2 months ago Actions #11

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom