lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5250b984-ce32-dc3b-5b8c-3937da4c4715@mojatatu.com>
Date: Mon, 10 Jul 2023 23:13:57 -0300
From: Pedro Tammela <pctammela@...atatu.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, edumazet@...gle.com, jhs@...atatu.com,
 jiri@...nulli.us, kuba@...nel.org, mysuryan@...co.com,
 netdev@...r.kernel.org, pabeni@...hat.com, vijaynsu@...co.com,
 xiyou.wangcong@...il.com
Subject: Re: [PATCH net] net/sched: make psched_mtu() RTNL-less safe

On 10/07/2023 21:14, Kuniyuki Iwashima wrote:
> From: Pedro Tammela <pctammela@...atatu.com>
> Date: Mon, 10 Jul 2023 21:04:29 -0300
>> Eric Dumazet says[1]:
>> ---
> 
> I think we shouldn't use `---` here, or the message below will
> be dropped while merging.

Thanks for catching this. Will resend.

> 
> 
>> Speaking of psched_mtu(), I see that net/sched/sch_pie.c is using it
>> without holding RTNL, so dev->mtu can be changed underneath.
>> KCSAN could issue a warning.
>> ---
>>
>> Annotate dev->mtu with READ_ONCE() so KCSAN don't issue a warning.
>>
>> [1] https://lore.kernel.org/all/CANn89iJoJO5VtaJ-2=_d2aOQhb0Xw8iBT_Cxqp2HyuS-zj6azw@mail.gmail.com/
>>
>> Fixes: d4b36210c2e6 ("net: pkt_sched: PIE AQM scheme")
>> Suggested-by: Eric Dumazet <edumazet@...gle.com>
>> Signed-off-by: Pedro Tammela <pctammela@...atatu.com>
>> ---
>>   include/net/pkt_sched.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
>> index e98aac9d5ad5..15960564e0c3 100644
>> --- a/include/net/pkt_sched.h
>> +++ b/include/net/pkt_sched.h
>> @@ -134,7 +134,7 @@ extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
>>    */
>>   static inline unsigned int psched_mtu(const struct net_device *dev)
>>   {
>> -	return dev->mtu + dev->hard_header_len;
>> +	return READ_ONCE(dev->mtu) + dev->hard_header_len;
>>   }
>>   
>>   static inline struct net *qdisc_net(struct Qdisc *q)
>> -- 
>> 2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ