[Devel] [PATCH RH7] netfilter: drop/reaquire nfnl_lock on request_module() in nft_log module

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 17 16:21:56 MSK 2020


On 07/17/2020 03:41 PM, Andrey Ryabinin wrote:
>
>
> On 7/16/20 8:21 PM, Konstantin Khorenko wrote:
>
>> If nc->call_batch() == nf_tables_newrule(), it means
>> nc == nf_tables_cb[NFT_MSG_NEWRULE]
>>
>> nc == &ss->cb[cb_id]
>> => ss == nf_tables_subsys
>>
>> and we know that nf_tables_subsys.subsys_id = NFNL_SUBSYS_NFTABLES
>>
>>
>> static const struct nfnetlink_subsystem nf_tables_subsys = {
>>         .name           = "nf_tables",
>>         .subsys_id      = NFNL_SUBSYS_NFTABLES,
>>         .cb             = nf_tables_cb,
>> ...
>>
>>
>> Proven?
>>
>
> Seems ok.
> FTR I was thinking about 'request_module_nowait(); return -EAGAIN;' as an alternative.

Ok, but how do we know when we can try checking again - and expect the loggers[pf][type] has been already registered?
i mean, it's possible the handle -EAGAIN in netlink code and return again into nf_logger_find_get_lock()
before modprobe loads the module we requested and thus loggers[pf][type] will be again empty.


More information about the Devel mailing list