Skip to contentSkip to conversation

xtables: Do not register matches/targets with incompatible revision

PATCH Phil Sutter 1 participant 1 message Sep 18, 2020 2 messages not in the archive netfilter

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Phil Sutter

author reviewer
#2 lore raw

Hi Serhey,

Quoted 2 lines · Serhey Popovych

If kernel tells revision isn't found/supported at the moment we should keep entity in pending list, not register or bail to do so later.

This causes a problem in particular with conntrack match (but others may be affected as well): If the kernel doesn't support an older revision of the match, it stays in pending list and is retried for each new rule using the match.

Quoted 2 lines

Kernel might still load module for entity we asking it for and this could be slow on some embedded devices.

Is this a speculative problem or did you see it in reality? I'm wondering because kernel uses try_then_request_module() to load the missing extension which calls __request_module() with 'wait' parameter set to true. So unless the called usermode helper is behaving unexpected (e.g. fork and load in background), the call to compatible_match_revision() should block until the module has been loaded, no?

Quoted 2 lines

Catch double registration attempts by checking me->next being non-NULL in xtables_register_match() and xtables_register_target().

Is this a side-effect of the above or an independent fix?

Cheers, Phil