[<prev] [next>] [day] [month] [year] [list]
Message-Id: <C29A816B-6E28-4A36-AE59-F446180C910B@yahoo.com>
Date: Thu, 13 Jul 2023 22:58:42 -0700
From: Astra Joan <astrajoan@...oo.com>
To: stephen@...workplumber.org
Cc: Astra Joan <astrajoan@...oo.com>,
davem@...emloft.net,
Dmitry Vyukov <dvyukov@...gle.com>,
edumazet@...gle.com,
ivan.orlov0322@...il.com,
kernel@...gutronix.de,
kuba@...nel.org,
linux-can@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux@...pel-privat.de,
mkl@...gutronix.de,
netdev@...r.kernel.org,
o.rempel@...gutronix.de,
pabeni@...hat.com,
robin@...tonic.nl,
skhan@...uxfoundation.org,
socketcan@...tkopp.net,
syzbot+1591462f226d9cbf0564@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com,
syzkaller@...glegroups.com
Subject: Re: [PATCH] can: j1939: prevent deadlock by changing j1939_socks_lock
to rwlock
Hi Stephen,
Thank you for your reply!
Changing the lock sequence may be difficult here since the function
- j1939_sk_errqueue
has may call sites. However, this function attempts to hold the
- j1939_socks_lock
whose hierchy is pretty high in the given code logic. On the other hand,
this function only reads from the
- j1939_socks_list
which the above lock protects against. Therefore, it seems appropriate to
lock the above list inside the function for read access only.
The RCU approach makes sense here, but I probably need to use RCU in
conjunction with other spinlocks and rwlocks in the codebase. Would that
be okay? If not, should I be looking into replacing all the locks with
RCU? I'm actually a mentee for the bug fixing mentorship this summer.
So please bear with me if some of these questions seem a bit naive :D
Thank you so much for your time!
Best regards,
Ziqi
Powered by blists - more mailing lists