Project

General

Profile

Actions

Bug #6044

closed

detect: multi-tenancy leaks memory if more than 1 tenant registered

Added by Victor Julien almost 1 year ago. Updated 8 months ago.

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

Description

=================================================================
==2442924==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x55cc97c9b098 in __interceptor_calloc (/home/victor/sync/devel/eidps/src/suricata+0x320098) (BuildId: 3286a1c86e92a05482cae6160adc262c526a4f76)
    #1 0x55cc97d2a8a9 in SCCallocFunc /home/victor/devel/eidps/src/util-mem.c:60:20
    #2 0x55cc982be663 in VarNameStoreInit /home/victor/devel/eidps/src/util-var-name.c:138:23
    #3 0x55cc982be041 in VarNameStoreSetupStaging /home/victor/devel/eidps/src/util-var-name.c:262:24
    #4 0x55cc97e8a001 in DetectEngineCtxInitReal /home/victor/devel/eidps/src/detect-engine.c:2528:5
    #5 0x55cc97e8a16f in DetectEngineCtxInitWithPrefix /home/victor/devel/eidps/src/detect-engine.c:2559:16
    #6 0x55cc97e9cf3b in DetectEngineMultiTenantLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3830:14
    #7 0x55cc97e9cbbb in DetectLoaderFuncLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3923:9
    #8 0x55cc97eb5cb3 in DetectLoader /home/victor/sync/devel/eidps/src/detect-engine-loader.c:602:21
    #9 0x55cc97cf8048 in TmThreadsManagement /home/victor/devel/eidps/src/tm-threads.c:552:9
    #10 0x7f160bfcdb42 in start_thread nptl/pthread_create.c:442:8

Indirect leak of 32768 byte(s) in 1 object(s) allocated from:
    #0 0x55cc97c9aeae in malloc (/home/victor/sync/devel/eidps/src/suricata+0x31feae) (BuildId: 3286a1c86e92a05482cae6160adc262c526a4f76)
    #1 0x55cc97d2a561 in SCMallocFunc /home/victor/devel/eidps/src/util-mem.c:31:20
    #2 0x55cc9820dbfb in HashListTableInit /home/victor/devel/eidps/src/util-hashlist.c:69:17
    #3 0x55cc982be73f in VarNameStoreInit /home/victor/devel/eidps/src/util-var-name.c:148:14
    #4 0x55cc982be041 in VarNameStoreSetupStaging /home/victor/devel/eidps/src/util-var-name.c:262:24
    #5 0x55cc97e8a001 in DetectEngineCtxInitReal /home/victor/devel/eidps/src/detect-engine.c:2528:5
    #6 0x55cc97e8a16f in DetectEngineCtxInitWithPrefix /home/victor/devel/eidps/src/detect-engine.c:2559:16
    #7 0x55cc97e9cf3b in DetectEngineMultiTenantLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3830:14
    #8 0x55cc97e9cbbb in DetectLoaderFuncLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3923:9
    #9 0x55cc97eb5cb3 in DetectLoader /home/victor/sync/devel/eidps/src/detect-engine-loader.c:602:21
    #10 0x55cc97cf8048 in TmThreadsManagement /home/victor/devel/eidps/src/tm-threads.c:552:9
    #11 0x7f160bfcdb42 in start_thread nptl/pthread_create.c:442:8

Indirect leak of 32768 byte(s) in 1 object(s) allocated from:
    #0 0x55cc97c9aeae in malloc (/home/victor/sync/devel/eidps/src/suricata+0x31feae) (BuildId: 3286a1c86e92a05482cae6160adc262c526a4f76)
    #1 0x55cc97d2a561 in SCMallocFunc /home/victor/devel/eidps/src/util-mem.c:31:20
    #2 0x55cc9820dbfb in HashListTableInit /home/victor/devel/eidps/src/util-hashlist.c:69:17
    #3 0x55cc982be6a5 in VarNameStoreInit /home/victor/devel/eidps/src/util-var-name.c:142:16
    #4 0x55cc982be041 in VarNameStoreSetupStaging /home/victor/devel/eidps/src/util-var-name.c:262:24
    #5 0x55cc97e8a001 in DetectEngineCtxInitReal /home/victor/devel/eidps/src/detect-engine.c:2528:5
    #6 0x55cc97e8a16f in DetectEngineCtxInitWithPrefix /home/victor/devel/eidps/src/detect-engine.c:2559:16
    #7 0x55cc97e9cf3b in DetectEngineMultiTenantLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3830:14
    #8 0x55cc97e9cbbb in DetectLoaderFuncLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3923:9
    #9 0x55cc97eb5cb3 in DetectLoader /home/victor/sync/devel/eidps/src/detect-engine-loader.c:602:21
    #10 0x55cc97cf8048 in TmThreadsManagement /home/victor/devel/eidps/src/tm-threads.c:552:9
    #11 0x7f160bfcdb42 in start_thread nptl/pthread_create.c:442:8

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x55cc97c9aeae in malloc (/home/victor/sync/devel/eidps/src/suricata+0x31feae) (BuildId: 3286a1c86e92a05482cae6160adc262c526a4f76)
    #1 0x55cc97d2a561 in SCMallocFunc /home/victor/devel/eidps/src/util-mem.c:31:20
    #2 0x55cc9820d99c in HashListTableInit /home/victor/devel/eidps/src/util-hashlist.c:53:10
    #3 0x55cc982be6a5 in VarNameStoreInit /home/victor/devel/eidps/src/util-var-name.c:142:16
    #4 0x55cc982be041 in VarNameStoreSetupStaging /home/victor/devel/eidps/src/util-var-name.c:262:24
    #5 0x55cc97e8a001 in DetectEngineCtxInitReal /home/victor/devel/eidps/src/detect-engine.c:2528:5
    #6 0x55cc97e8a16f in DetectEngineCtxInitWithPrefix /home/victor/devel/eidps/src/detect-engine.c:2559:16
    #7 0x55cc97e9cf3b in DetectEngineMultiTenantLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3830:14
    #8 0x55cc97e9cbbb in DetectLoaderFuncLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3923:9
    #9 0x55cc97eb5cb3 in DetectLoader /home/victor/sync/devel/eidps/src/detect-engine-loader.c:602:21
    #10 0x55cc97cf8048 in TmThreadsManagement /home/victor/devel/eidps/src/tm-threads.c:552:9
    #11 0x7f160bfcdb42 in start_thread nptl/pthread_create.c:442:8

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x55cc97c9aeae in malloc (/home/victor/sync/devel/eidps/src/suricata+0x31feae) (BuildId: 3286a1c86e92a05482cae6160adc262c526a4f76)
    #1 0x55cc97d2a561 in SCMallocFunc /home/victor/devel/eidps/src/util-mem.c:31:20
    #2 0x55cc9820d99c in HashListTableInit /home/victor/devel/eidps/src/util-hashlist.c:53:10
    #3 0x55cc982be73f in VarNameStoreInit /home/victor/devel/eidps/src/util-var-name.c:148:14
    #4 0x55cc982be041 in VarNameStoreSetupStaging /home/victor/devel/eidps/src/util-var-name.c:262:24
    #5 0x55cc97e8a001 in DetectEngineCtxInitReal /home/victor/devel/eidps/src/detect-engine.c:2528:5
    #6 0x55cc97e8a16f in DetectEngineCtxInitWithPrefix /home/victor/devel/eidps/src/detect-engine.c:2559:16
    #7 0x55cc97e9cf3b in DetectEngineMultiTenantLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3830:14
    #8 0x55cc97e9cbbb in DetectLoaderFuncLoadTenant /home/victor/devel/eidps/src/detect-engine.c:3923:9
    #9 0x55cc97eb5cb3 in DetectLoader /home/victor/sync/devel/eidps/src/detect-engine-loader.c:602:21
    #10 0x55cc97cf8048 in TmThreadsManagement /home/victor/devel/eidps/src/tm-threads.c:552:9
    #11 0x7f160bfcdb42 in start_thread nptl/pthread_create.c:442:8

SUMMARY: AddressSanitizer: 65672 byte(s) leaked in 5 allocation(s).

Subtasks 1 (0 open1 closed)

Bug #6045: detect: multi-tenancy leaks memory if more than 1 tenant registered (6.0.x backport)ClosedJeff LucovskyActions

Related issues 1 (0 open1 closed)

Related to Suricata - Bug #6201: multi-tenancy: crash under test mode when tenant signature load failsClosedVictor JulienActions
Actions #1

Updated by Victor Julien almost 1 year ago

  • Label Needs backport to 6.0 added

Happens in 6 as well.

Actions #2

Updated by OISF Ticketbot almost 1 year ago

  • Subtask #6045 added
Actions #3

Updated by OISF Ticketbot almost 1 year ago

  • Label deleted (Needs backport to 6.0)
Actions #4

Updated by Juliana Fajardini Reichow 12 months ago

  • Target version changed from 7.0.0-rc2 to 7.0.0
Actions #5

Updated by Juliana Fajardini Reichow 12 months ago

  • Assignee changed from OISF Dev to Jeff Lucovsky
  • Target version changed from 7.0.0 to 7.0.1
Actions #6

Updated by Jeff Lucovsky 11 months ago

I wasn't able to reproduce this with
- 3 tenants, each with a different rules file
- Live traffic using af-packet
- vlan selectors

@Victor Julien What MT configuration settings /ruleset were in use when this occurred?

Actions #7

Updated by Victor Julien 9 months ago

  • Status changed from New to In Progress
  • Assignee changed from Jeff Lucovsky to Victor Julien
Actions #8

Updated by Victor Julien 9 months ago

  • Related to Bug #6201: multi-tenancy: crash under test mode when tenant signature load fails added
Actions #9

Updated by Victor Julien 9 months ago

  • Status changed from In Progress to In Review
Actions #10

Updated by Victor Julien 9 months ago

  • Status changed from In Review to Resolved
Actions #11

Updated by Victor Julien 8 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF