Skip to content

Ish/6.0.x/Staging/v1#9414

Closed
jasonish wants to merge 7 commits into
OISF:master-6.0.xfrom
jasonish:Ish/6.0.x/Staging/v1
Closed

Ish/6.0.x/Staging/v1#9414
jasonish wants to merge 7 commits into
OISF:master-6.0.xfrom
jasonish:Ish/6.0.x/Staging/v1

Conversation

@jasonish
Copy link
Copy Markdown
Member

@jasonish jasonish commented Aug 28, 2023

hsadia538 and others added 6 commits August 19, 2023 07:03
Add a new DNS record type to represent HTTPS
Ticket: OISF#4751

(cherry picked from commit 8d5c5f2)
If the interface and copy-iface are same for an af-packet IPS device
setting then fataly exit else it leads to a segfault in later stages.

Bug 5870

(cherry picked from commit d4dd53c)
Implement a new design for handling var name id's. The old logic
was aware of detection engine versions and generally didn't work
well for multi-tenancy cases. Other than memory leaks and crashes,
logging of var names worked or failed based on which tenant was
loaded last.

This patch implements a new approach, where there is a global store
of vars and their id's for the lifetime of the program.

Overall Design:

Base Store: "base"

Used during keyword registration. Operates under lock. Base is shared
between all detect engines, detect engine versions and tenants.
Each variable name is ref counted.

During the freeing of a detect engine / tenant, unregistration decreases
the ref cnt.

Base has both a string to id and a id to string hash table. String to
id is used during parsing/registration. id to string during unregistration.

Active Store Pointer (atomic)

The "active" store atomic pointer points to the active lookup store. The call
to `VarNameStoreActivate` will build a new lookup store and hot swap
the pointer.

Ensuring memory safety. During the hot swap, the pointer is replaced, so
any new call to the lookup functions will automatically use the new store.
This leaves the case of any lookup happening concurrently with the pointer
swap. For this case we add the old store to a free list. It gets a timestamp
before which it cannot be freed.

Free List

The free list contains old stores that are waiting to get removed. They
contain a timestamp that is checked before they are freed.

Bug: OISF#6044.
Bug: OISF#6201.
(cherry picked from commit b130234)
Make sure thread ctx registration happens and id remains correct
in case of reloads.

To do so, move id var into the detect ctx.

(cherry picked from commit 2cac440)
Take windows directory separators into account.

Path is not checked or "resolved".

(cherry picked from commit 228caa6)
@jasonish jasonish changed the title Ish/6.0.x/Staging/v1 Draft: Ish/6.0.x/Staging/v1 Aug 28, 2023
@suricata-qa
Copy link
Copy Markdown

Information: QA ran without warnings.

Pipeline 15765

When comparing IPv6 addresses based on uint32_t chunks, one needs to
apply ntohl() conversion to the individual parts, otherwise on little
endian systems individual bytes are compared in the wrong order.
Avoid this all and leverage memcmp(), it'll short circuit on the first
differing byte and its return values tells us which address sorts lower.

Bug: OISF#6276
(cherry picked from commit ccefbd8)
@suricata-qa
Copy link
Copy Markdown

Information: QA ran without warnings.

Pipeline 15789

@jasonish
Copy link
Copy Markdown
Member Author

Cherry pick error is expected:

COMMIT cf22cdb268466919875f0ad5d88548db024bf70d: ERROR ccefbd80268a3fe947b43cb9facd613173e02b68 not found in remotes/origin/master

@jasonish jasonish marked this pull request as ready for review September 2, 2023 15:08
@jasonish jasonish requested review from a team and victorjulien as code owners September 2, 2023 15:08
@jasonish jasonish changed the title Draft: Ish/6.0.x/Staging/v1 Ish/6.0.x/Staging/v1 Sep 2, 2023
@victorjulien
Copy link
Copy Markdown
Member

Master commits will be different, so cherry-pick line will stay wrong.

@jasonish jasonish deleted the Ish/6.0.x/Staging/v1 branch February 8, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants