From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
syzbot+0cb5bb0f4bf9e79db3b3@syzkaller.appspotmail.com,
Daniel Jordan <daniel.m.jordan@oracle.com>,
Sasha Levin <sashal@kernel.org>,
steffen.klassert@secunet.com, linux-crypto@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 1/5] padata: Disable BH when taking works lock on MT path
Date: Sun, 26 May 2024 05:43:37 -0400 [thread overview]
Message-ID: <20240526094342.3413841-1-sashal@kernel.org> (raw)
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 fdcd78302cd72..471ccbc44541d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -111,7 +111,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();
@@ -121,7 +121,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;
}
@@ -139,12 +139,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
next reply other threads:[~2024-05-26 9:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-26 9:43 Sasha Levin [this message]
2024-05-26 9:43 ` [PATCH AUTOSEL 5.10 2/5] rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment Sasha Levin
2024-05-26 9:43 ` [PATCH AUTOSEL 5.10 3/5] rcutorture: Fix invalid context warning when enable srcu barrier testing Sasha Levin
2024-05-26 9:43 ` [PATCH AUTOSEL 5.10 4/5] binfmt_elf: Leave a gap between .bss and brk Sasha Levin
2024-05-26 9:43 ` [PATCH AUTOSEL 5.10 5/5] block/ioctl: prefer different overflow check Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240526094342.3413841-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=daniel.m.jordan@oracle.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=syzbot+0cb5bb0f4bf9e79db3b3@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox