From patchwork Mon Nov 23 20:14:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11926661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A09A3C388F9 for ; Mon, 23 Nov 2020 20:31:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBEE920715 for ; Mon, 23 Nov 2020 20:31:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GIpl12R5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="vE2RlTTz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBEE920715 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VEg4mwdvjJCoytY0BsjiWSQW9b8ZNFKcnxb4ClozOYs=; b=GIpl12R56No7RzvfeanGRY9sl A/Cj+JWZ8rOeYOQPZ1QZtmGJNRBMrLVigiILnh92f2Z+TbfIFTI5Fw9va2NyvI7MYc0UHyxBXHrx3 r9IO6V55EWki1kYqMVd4TwUeGn2UZjDbqPH4I/GGk4xmLPyg5XdVdkPTltK/mMxF0lZdfyrHUJLGc sK3Hkx+bozACLtPylIt2vjoEZNFgjYyXcQd7L9Gs1VB1Fm8grhLImZpDrf6liEcSx0ICo/9pKhPvq Luyr2WMDwj8yIZbIsDLf0MqNaeZYBcNXCUQrYt1rwV4m7p4XdCkw4QyB7Ob41TpuVBB/yKQoifoPq jfAkaR8yA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khITX-0000WS-ON; Mon, 23 Nov 2020 20:30:15 +0000 Received: from mail-qk1-x749.google.com ([2607:f8b0:4864:20::749]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIEm-00026f-As for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 20:15:02 +0000 Received: by mail-qk1-x749.google.com with SMTP id c18so15559587qkl.15 for ; Mon, 23 Nov 2020 12:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=X8He+i5DTpgfYKqVr7f46nksdkLo8KZ5P0WRCUmFYW8=; b=vE2RlTTzBzO5Gu2A4Wlttso8aG+Md8VyWf3JRDOc1Rk1bLUV819+D3mRFk8KL3kdCG eXUGqYHjERGJSQYpOySgTRgSxDqdgGaOMismdtSjBIQFp7VMipUQnz3fsflxJBsTgjmH NTkvIqSK2uP2oEw57s2L/OQz6kWSVTj1zYVffNLK8eHvX8vuv0hOk/6SCps9Wj1XwINP adkHqjEHjQsc17VN0LO03Evgdty940In8beiJqeKz0sawcA/v6PNFAx/exm7EBcnbW+R oqSoQUga4Kh5eizfSuq5arMaMeewWgBhiYoyf2DJQl0xvTuFK0f+3u+3d79cZRKSlWGJ CCnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=X8He+i5DTpgfYKqVr7f46nksdkLo8KZ5P0WRCUmFYW8=; b=dbmBgS1CACTGK+2DXwUqaehnZES0hD/+eNGwQzQXwgFcq3csmat/bFBa1fbwcGvmtv YN9VZyqoHRcWzgEZEaWzWTkwzc7NgUGcj4wShoqM2klRtJ2zMVSBdbfeZ3kNKFuSdkfv BFyC9r84mtVbhjvC4EPseKiO7tAnoR+izsiFslbkVw3ZCd8ch/Kd1jSwi+mkfKxZ4N+J 4EAFF+AyEApXY1pxPYlbwHc6lQWK8hMbJneKyt+v96fex+s1PT5GtYzXjYo1P/SJBAm7 C9Q7NZQDmuSBnTa4X2+RVgcVk9Z3UqH3VUR8wZBVmVVjmMR/vZUv01lBgivfMgYQFqx9 VAfw== X-Gm-Message-State: AOAM532Hu8RLupjHpaF8CPcHhklL2q6T07SiVDmjqNuE9IbFwccBwKH/ KzJR7scgwYAc0nSkBeVUb4pM1CE4GpXD7rzs X-Google-Smtp-Source: ABdhPJwdwL1lWnof+uE3ypolP2P0M2AIXFB3wOTJiySzgHkkoCi1sbMWbkPHW5t6+b/xqQEPSNiAl3jFR3LB4TT+ X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:eac4:: with SMTP id y4mr1134178qvp.19.1606162496039; Mon, 23 Nov 2020 12:14:56 -0800 (PST) Date: Mon, 23 Nov 2020 21:14:31 +0100 In-Reply-To: Message-Id: <312d0a3ef92cc6dc4fa5452cbc1714f9393ca239.1606162397.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH mm v4 01/19] kasan: simplify quarantine_put call site From: Andrey Konovalov To: Andrew Morton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_151500_461896_295A1C5A X-CRM114-Status: GOOD ( 14.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Marco Elver , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move get_free_info() call into quarantine_put() to simplify the call site. No functional changes. Signed-off-by: Andrey Konovalov Reviewed-by: Dmitry Vyukov Reviewed-by: Marco Elver 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