[PATCH net,v2] net: ppp: Fix deadlock caused by unsafe-irq lock in ap_get()
From: Jeongjun Park
Date: Fri Apr 19 2024 - 14:13:25 EST
read_lock() present in ap_get() is interrupt-vulnerable, so the function needs to be modified.
Reported-by: syzbot+393d0ef63475d9bb1f16@xxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Jeongjun Park <aha310510@xxxxxxxxx>
---
drivers/net/ppp/ppp_async.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index c33c3db3cc08..d12b8155e839 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -134,11 +134,11 @@ static struct asyncppp *ap_get(struct tty_struct *tty)
{
struct asyncppp *ap;
- read_lock(&disc_data_lock);
+ read_lock_irq(&disc_data_lock);
ap = tty->disc_data;
if (ap != NULL)
refcount_inc(&ap->refcnt);
- read_unlock(&disc_data_lock);
+ read_unlock_irq(&disc_data_lock);
return ap;
}
--
2.34.1