* + ipc-sem-do-not-sleep-with-a-spin-lock-held.patch added to -mm tree
@ 2021-12-30 0:40 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-12-30 0:40 UTC (permalink / raw)
To: mm-commits, zealci, vvs, unixbhaskar, shakeelb, rdunlap, dbueso,
cgel.zte, arnd, chi.minghao
The patch titled
Subject: ipc/sem: do not sleep with a spin lock held
has been added to the -mm tree. Its filename is
ipc-sem-do-not-sleep-with-a-spin-lock-held.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/ipc-sem-do-not-sleep-with-a-spin-lock-held.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/ipc-sem-do-not-sleep-with-a-spin-lock-held.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Minghao Chi <chi.minghao@zte.com.cn>
Subject: ipc/sem: do not sleep with a spin lock held
We can't call kvfree() with a spin lock held, so defer it.
Link: https://lkml.kernel.org/r/20211223031207.556189-1-chi.minghao@zte.com.cn
Fixes: fc37a3b8b438 ("[PATCH] ipc sem: use kvmalloc for sem_undo allocation")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Yang Guang <cgel.zte@gmail.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Cc: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
ipc/sem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/ipc/sem.c~ipc-sem-do-not-sleep-with-a-spin-lock-held
+++ a/ipc/sem.c
@@ -1964,6 +1964,7 @@ static struct sem_undo *find_alloc_undo(
*/
un = lookup_undo(ulp, semid);
if (un) {
+ spin_unlock(&ulp->lock);
kvfree(new);
goto success;
}
@@ -1976,9 +1977,8 @@ static struct sem_undo *find_alloc_undo(
ipc_assert_locked_object(&sma->sem_perm);
list_add(&new->list_id, &sma->list_id);
un = new;
-
-success:
spin_unlock(&ulp->lock);
+success:
sem_unlock(sma, -1);
out:
return un;
_
Patches currently in -mm which might be from chi.minghao@zte.com.cn are
mm-remove-unneeded-variable.patch
selftests-vm-use-swap-to-make-code-cleaner.patch
fs-adfs-remove-unneeded-variable-make-code-cleaner.patch
ipc-sem-do-not-sleep-with-a-spin-lock-held.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-30 0:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30 0:40 + ipc-sem-do-not-sleep-with-a-spin-lock-held.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.