public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 1/7] padata: Disable BH when taking works lock on MT path
@ 2024-05-26  9:43 Sasha Levin
  2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 2/7] crypto: hisilicon/sec - Fix memory leak for sec resource release Sasha Levin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sasha Levin @ 2024-05-26  9:43 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Herbert Xu, syzbot+0cb5bb0f4bf9e79db3b3, Daniel Jordan,
	Sasha Levin, steffen.klassert, linux-crypto

From: Herbert Xu <herbert@gondor.apana.org.au>

[ Upstream commit 58329c4312031603bb1786b44265c26d5065fe72 ]

As the old padata code can execute in softirq context, disable
softirqs for the new padata_do_mutithreaded code too as otherwise
lockdep will get antsy.

Reported-by: syzbot+0cb5bb0f4bf9e79db3b3@syzkaller.appspotmail.com
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/padata.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/padata.c b/kernel/padata.c
index 47f146f061fb1..809978bb249c2 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -98,7 +98,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
 {
 	int i;
 
-	spin_lock(&padata_works_lock);
+	spin_lock_bh(&padata_works_lock);
 	/* Start at 1 because the current task participates in the job. */
 	for (i = 1; i < nworks; ++i) {
 		struct padata_work *pw = padata_work_alloc();
@@ -108,7 +108,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
 		padata_work_init(pw, padata_mt_helper, data, 0);
 		list_add(&pw->pw_list, head);
 	}
-	spin_unlock(&padata_works_lock);
+	spin_unlock_bh(&padata_works_lock);
 
 	return i;
 }
@@ -126,12 +126,12 @@ static void __init padata_works_free(struct list_head *works)
 	if (list_empty(works))
 		return;
 
-	spin_lock(&padata_works_lock);
+	spin_lock_bh(&padata_works_lock);
 	list_for_each_entry_safe(cur, next, works, pw_list) {
 		list_del(&cur->pw_list);
 		padata_work_free(cur);
 	}
-	spin_unlock(&padata_works_lock);
+	spin_unlock_bh(&padata_works_lock);
 }
 
 static void padata_parallel_worker(struct work_struct *parallel_work)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-26  9:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-26  9:43 [PATCH AUTOSEL 5.15 1/7] padata: Disable BH when taking works lock on MT path Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 2/7] crypto: hisilicon/sec - Fix memory leak for sec resource release Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 3/7] rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 4/7] rcutorture: Make stall-tasks directly exit when rcutorture tests end Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 5/7] rcutorture: Fix invalid context warning when enable srcu barrier testing Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 6/7] binfmt_elf: Leave a gap between .bss and brk Sasha Levin
2024-05-26  9:43 ` [PATCH AUTOSEL 5.15 7/7] block/ioctl: prefer different overflow check Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox