linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	 Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	 Marco Elver <elver@google.com>,
	Evgenii Stepanov <eugenis@google.com>,
	 Branislav Rankov <Branislav.Rankov@arm.com>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	 kasan-dev@googlegroups.com,
	linux-arm-kernel@lists.infradead.org,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	 Andrey Konovalov <andreyknvl@google.com>
Subject: [PATCH mm v4 01/19] kasan: simplify quarantine_put call site
Date: Mon, 23 Nov 2020 21:14:31 +0100	[thread overview]
Message-ID: <312d0a3ef92cc6dc4fa5452cbc1714f9393ca239.1606162397.git.andreyknvl@google.com> (raw)
In-Reply-To: <cover.1606162397.git.andreyknvl@google.com>

Move get_free_info() call into quarantine_put() to simplify the call site.

No functional changes.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Link: https://linux-review.googlesource.com/id/Iab0f04e7ebf8d83247024b7190c67c3c34c7940f
---
 mm/kasan/common.c     | 2 +-
 mm/kasan/kasan.h      | 5 ++---
 mm/kasan/quarantine.c | 3 ++-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/kasan/common.c b/mm/kasan/common.c
index 998aede4d172..e11fac2ee30c 100644
--- a/mm/kasan/common.c
+++ b/mm/kasan/common.c
@@ -317,7 +317,7 @@ static bool __kasan_slab_free(struct kmem_cache *cache, void *object,
 
 	kasan_set_free_info(cache, object, tag);
 
-	quarantine_put(get_free_info(cache, object), cache);
+	quarantine_put(cache, object);
 
 	return IS_ENABLED(CONFIG_KASAN_GENERIC);
 }
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index 64560cc71191..13c511e85d5f 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -216,12 +216,11 @@ struct kasan_track *kasan_get_free_track(struct kmem_cache *cache,
 
 #if defined(CONFIG_KASAN_GENERIC) && \
 	(defined(CONFIG_SLAB) || defined(CONFIG_SLUB))
-void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache);
+void quarantine_put(struct kmem_cache *cache, void *object);
 void quarantine_reduce(void);
 void quarantine_remove_cache(struct kmem_cache *cache);
 #else
-static inline void quarantine_put(struct kasan_free_meta *info,
-				struct kmem_cache *cache) { }
+static inline void quarantine_put(struct kmem_cache *cache, void *object) { }
 static inline void quarantine_reduce(void) { }
 static inline void quarantine_remove_cache(struct kmem_cache *cache) { }
 #endif
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
index 580ff5610fc1..a0792f0d6d0f 100644
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@ -161,11 +161,12 @@ static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)
 	qlist_init(q);
 }
 
-void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache)
+void quarantine_put(struct kmem_cache *cache, void *object)
 {
 	unsigned long flags;
 	struct qlist_head *q;
 	struct qlist_head temp = QLIST_INIT;
+	struct kasan_free_meta *info = get_free_info(cache, object);
 
 	/*
 	 * Note: irq must be disabled until after we move the batch to the
-- 
2.29.2.454.gaff20da3a2-goog



  reply	other threads:[~2020-11-23 20:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 20:14 [PATCH mm v4 00/19] kasan: boot parameters for hardware tag-based mode Andrey Konovalov
2020-11-23 20:14 ` Andrey Konovalov [this message]
2020-11-23 20:14 ` [PATCH mm v4 02/19] kasan: rename get_alloc/free_info Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 03/19] kasan: introduce set_alloc_info Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 04/19] kasan, arm64: unpoison stack only with CONFIG_KASAN_STACK Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 05/19] kasan: allow VMAP_STACK for HW_TAGS mode Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 06/19] kasan: remove __kasan_unpoison_stack Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 07/19] kasan: inline kasan_reset_tag for tag-based modes Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 08/19] kasan: inline random_tag for HW_TAGS Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 09/19] kasan: open-code kasan_unpoison_slab Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 10/19] kasan: inline (un)poison_range and check_invalid_free Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 11/19] kasan: add and integrate kasan boot parameters Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 12/19] kasan, mm: check kasan_enabled in annotations Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 13/19] kasan, mm: rename kasan_poison_kfree Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 14/19] kasan: don't round_up too much Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 15/19] kasan: simplify assign_tag and set_tag calls Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 16/19] kasan: clarify comment in __kasan_kfree_large Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 17/19] kasan: sanitize objects when metadata doesn't fit Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 18/19] kasan, mm: allow cache merging with no metadata Andrey Konovalov
2020-11-23 20:14 ` [PATCH mm v4 19/19] kasan: update documentation Andrey Konovalov

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=312d0a3ef92cc6dc4fa5452cbc1714f9393ca239.1606162397.git.andreyknvl@google.com \
    --to=andreyknvl@google.com \
    --cc=Branislav.Rankov@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=eugenis@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=will.deacon@arm.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