All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: 1vier1@web.de, arnd@arndb.de, cgel.zte@gmail.com,
	chi.minghao@zte.com.cn, dbueso@suse.de, manfred@colorfullife.com,
	mhocko@kernel.org, mm-commits@vger.kernel.org,
	rdunlap@infradead.org, shakeelb@google.com,
	stable@vger.kernel.org, unixbhaskar@gmail.com, urezki@gmail.com,
	vvs@virtuozzo.com, zealci@zte.com.cn
Subject: [alternative-merged] mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch removed from -mm tree
Date: Thu, 27 Jan 2022 14:01:26 -0800	[thread overview]
Message-ID: <20220127220126.zRE0qPjlu%akpm@linux-foundation.org> (raw)


The patch titled
     Subject: mm/util.c: make kvfree() safe for calling while holding spinlocks
has been removed from the -mm tree.  Its filename was
     mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch

This patch was dropped because an alternative patch was merged

------------------------------------------------------
From: Manfred Spraul <manfred@colorfullife.com>
Subject: mm/util.c: make kvfree() safe for calling while holding spinlocks

One codepath in find_alloc_undo() calls kvfree() while holding a spinlock.
Since vfree() can sleep this is a bug.

Previously, the code path used kfree(), and kfree() is safe to be called
while holding a spinlock.

Minghao proposed to fix this by updating find_alloc_undo().

Alternate proposal to fix this: Instead of changing find_alloc_undo(),
change kvfree() so that the same rules as for kfree() apply: Having
different rules for kfree() and kvfree() just asks for bugs.

Disadvantage: Releasing vmalloc'ed memory will be delayed a bit.

Link: https://lkml.kernel.org/r/20211222194828.15320-1-manfred@colorfullife.com
Link: https://lore.kernel.org/all/20211222081026.484058-1-chi.minghao@zte.com.cn/
Fixes: fc37a3b8b438 ("[PATCH] ipc sem: use kvmalloc for sem_undo allocation")
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Reported-by: Minghao Chi <chi.minghao@zte.com.cn>
Cc: Vasily Averin <vvs@virtuozzo.com>
Cc: CGEL ZTE <cgel.zte@gmail.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: <1vier1@web.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/util.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/util.c~mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks
+++ a/mm/util.c
@@ -603,12 +603,12 @@ EXPORT_SYMBOL(kvmalloc_node);
  * It is slightly more efficient to use kfree() or vfree() if you are certain
  * that you know which one to use.
  *
- * Context: Either preemptible task context or not-NMI interrupt.
+ * Context: Any context except NMI interrupt.
  */
 void kvfree(const void *addr)
 {
 	if (is_vmalloc_addr(addr))
-		vfree(addr);
+		vfree_atomic(addr);
 	else
 		kfree(addr);
 }
_

Patches currently in -mm which might be from manfred@colorfullife.com are



                 reply	other threads:[~2022-01-27 22:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220127220126.zRE0qPjlu%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=1vier1@web.de \
    --cc=arnd@arndb.de \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mhocko@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=shakeelb@google.com \
    --cc=stable@vger.kernel.org \
    --cc=unixbhaskar@gmail.com \
    --cc=urezki@gmail.com \
    --cc=vvs@virtuozzo.com \
    --cc=zealci@zte.com.cn \
    /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 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.