From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E94B2C433FE for ; Mon, 3 Oct 2022 21:08:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbiJCVId (ORCPT ); Mon, 3 Oct 2022 17:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbiJCVG3 (ORCPT ); Mon, 3 Oct 2022 17:06:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0CDC4DB4B for ; Mon, 3 Oct 2022 14:05:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6835D6118C for ; Mon, 3 Oct 2022 21:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBC53C433D6; Mon, 3 Oct 2022 21:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1664831149; bh=C0KZFhQIRzXrPBVhUZJnsbNbjRyr1ZhITfCQ4Z245cs=; h=Date:To:From:Subject:From; b=ZzpnUgnZK8nwK8mud4T6dmAA4m/c8CTcJSwo0F/zPzf+8fZeGWRQD9aJ3+Mrr37o3 NX6Q7z77MIYfNyv867ohc3VYKW2HTzP8JgP5MRhgJ6MWLcWijpIKzWKMUZNzwZcz5F jBIW74h5OACuqq8DagSZLIlop6oxs0XNrzula4J4= Date: Mon, 03 Oct 2022 14:05:49 -0700 To: mm-commits@vger.kernel.org, ryabinin.a.a@gmail.com, pcc@google.com, glider@google.com, eugenis@google.com, elver@google.com, dvyukov@google.com, andreyknvl@google.com, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] kasan-move-is_kmalloc-check-out-of-save_alloc_info.patch removed from -mm tree Message-Id: <20221003210549.BBC53C433D6@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The quilt patch titled Subject: kasan: move is_kmalloc check out of save_alloc_info has been removed from the -mm tree. Its filename was kasan-move-is_kmalloc-check-out-of-save_alloc_info.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Andrey Konovalov Subject: kasan: move is_kmalloc check out of save_alloc_info Date: Mon, 5 Sep 2022 23:05:18 +0200 Move kasan_info.is_kmalloc check out of save_alloc_info(). This is a preparatory change that simplifies the following patches in this series. Link: https://lkml.kernel.org/r/df89f1915b788f9a10319905af6d0202a3b30c30.1662411799.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Peter Collingbourne Signed-off-by: Andrew Morton --- mm/kasan/common.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) --- a/mm/kasan/common.c~kasan-move-is_kmalloc-check-out-of-save_alloc_info +++ a/mm/kasan/common.c @@ -424,15 +424,10 @@ void __kasan_slab_free_mempool(void *ptr } } -static void save_alloc_info(struct kmem_cache *cache, void *object, - gfp_t flags, bool is_kmalloc) +static void save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags) { struct kasan_alloc_meta *alloc_meta; - /* Don't save alloc info for kmalloc caches in kasan_slab_alloc(). */ - if (cache->kasan_info.is_kmalloc && !is_kmalloc) - return; - alloc_meta = kasan_get_alloc_meta(cache, object); if (alloc_meta) kasan_set_track(&alloc_meta->alloc_track, flags); @@ -467,8 +462,8 @@ void * __must_check __kasan_slab_alloc(s kasan_unpoison(tagged_object, cache->object_size, init); /* Save alloc info (if possible) for non-kmalloc() allocations. */ - if (kasan_stack_collection_enabled()) - save_alloc_info(cache, (void *)object, flags, false); + if (kasan_stack_collection_enabled() && !cache->kasan_info.is_kmalloc) + save_alloc_info(cache, (void *)object, flags); return tagged_object; } @@ -513,8 +508,8 @@ static inline void *____kasan_kmalloc(st * Save alloc info (if possible) for kmalloc() allocations. * This also rewrites the alloc info when called from kasan_krealloc(). */ - if (kasan_stack_collection_enabled()) - save_alloc_info(cache, (void *)object, flags, true); + if (kasan_stack_collection_enabled() && cache->kasan_info.is_kmalloc) + save_alloc_info(cache, (void *)object, flags); /* Keep the tag that was set by kasan_slab_alloc(). */ return (void *)object; _ Patches currently in -mm which might be from andreyknvl@google.com are kasan-fix-array-bounds-warnings-in-tests.patch