Re: [PATCH net v5 08/10] ip6mr: Lock RCU before ip6mr_get_table() call in ip6_mroute_getsockopt()
From: Stefan Wiehler
Date: Wed Oct 16 2024 - 09:29:17 EST
>> + rcu_read_lock();
>> mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
>> + rcu_read_unlock();
>> if (!mrt)
>> return -ENOENT;
>
> presumably you're trying to protect mrt with RCU?
> so using mrt after unlocking is not right, you gotta hold the lock
> longer
Thanks, you're right of course, I'll be fixing this everywhere and send a v6
shortly; also with more extensive reasoning for this series in the cover
letter.
Kind regards,
Stefan