Skip to content

Nftables: Avoid race condition between update and evaluation. - #13898

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl955981065
Open

Nftables: Avoid race condition between update and evaluation.#13898
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl955981065

Conversation

@copybara-service

Copy link
Copy Markdown

Nftables: Avoid race condition between update and evaluation.

  • There was no lock taken for Nftables rule evaluation.
    So, it could happen that while processing and simultaneous update,
    a packet could pass to half updated ruleset.

  • Changed logic to replace atomic pointer, instead of
    replacing fields in the Nftables.

  • All the rule evaluation, can now go without needing any reader lock.

  • A lock is require for updating Nftables object though,
    to serialize the Netlink messages.

- There was no lock taken for Nftables rule evaluation.
    So, it could happen that while processing and simultaneous update,
    a packet could pass to half updated ruleset.

- Changed logic to replace atomic pointer, instead of
    replacing fields in the Nftables.

- All the rule evaluation, can now go without needing any reader lock.

- A lock is require for updating Nftables object though,
   to serialize the Netlink messages.

PiperOrigin-RevId: 955981065
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant