Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4352701pxb; Tue, 10 Nov 2020 14:22:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxucguyH1HXV6MavCZYwHtdU5UnxfdZM6snk3eR3RdR9klnV6ia3GpCKoxrxwBRhXQDdXdJ X-Received: by 2002:a50:d616:: with SMTP id x22mr23229432edi.221.1605046962530; Tue, 10 Nov 2020 14:22:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605046962; cv=none; d=google.com; s=arc-20160816; b=MVxV0EymavBmy4snG0E4AhrRRNEFn/ZVmcT8+8sak+uTN3jPv4+kEblx6tUqMmYIFC qqTXfgsDpK3A8TaJGKV4mEc7GEL8bJpuj15V2Y94Q6SguxqR7A4i4K7azciaNiTJ3Ql6 QRNh7dGAnY3thIzdP/tWRGwxt9dZYnAGAfjeY4Q7GADBKKRiZD7ObAV1/upnmA25fWef eph3hrUrrvP7BHwNSZjJL7Kt1pD4DNPOAhj9zDFY4IfH7VHEeDwb4s/LuAfMljZIe6bV YFO/cl2ODBKriSE0MJY9tjOdXfcyFCGi4G2sogzBSdC12Q96gis15cxQ5fCikU6PpScD SKWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=SMV12gvgXWyti1wWozncOBF2sC/NzCwG5tM1W9vYuH4=; b=HaYh+SwjTmwUHmuDtqW6mgDklucHXnIgCfDDRxhGtWVZqGnGz7d/OXQEczWA9p6qor Rl4gLkBnckuzydJFhuE7j/jSP716oRQ6Q3WrplqJK7CxZf9cv7TF7hmukb+pg6c8yHJX tkZkGcgAuFty1s4W/uYP/pHkjBWwJlLmGxZoFDqceIad9fas2bly7n8Zy3lQdxqwy1py oR31fpZU0KvBSqCC/OYARMSIt/K34WNmJ1V7wZWgKrDXu1RkRAq7e+sDRxxYiROUGZ7K 6HSYp/GVr85ADVDnSbySRlZM/f9rxQnkKL9AP7KkSgzFynOjkrtY3nQO7B1veZlm8loW lupg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B6QwfVBA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si68603edh.74.2020.11.10.14.22.17; Tue, 10 Nov 2020 14:22:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=B6QwfVBA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731984AbgKJWUe (ORCPT + 99 others); Tue, 10 Nov 2020 17:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727275AbgKJWUd (ORCPT ); Tue, 10 Nov 2020 17:20:33 -0500 Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC05C0613D1 for ; Tue, 10 Nov 2020 14:20:32 -0800 (PST) Received: by mail-wm1-x349.google.com with SMTP id y1so1868173wma.5 for ; Tue, 10 Nov 2020 14:20:32 -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=SMV12gvgXWyti1wWozncOBF2sC/NzCwG5tM1W9vYuH4=; b=B6QwfVBAz7pkQ6yN3GQqARn2ii4rZdYmih8xg6h0+kbT6exEYUg4pd4Iohk94eyM1c mfyXHR7Pxl38SAXC+UEdfwWOGQNZDQyHqw0WxKX+1aldC5Nh33y9y1wUbwjCW1D0yajz 82APgf+BpR2WC3RpKvYiDkV8kFzJxpoXE7CFk42ZB+MpjTlBxJm0XvKG7IxF4CW0/YAU G5dkj7NUrzW4l90Z8ZrgBn308BRtQCP8KJTgZyqtc9ySrVSwXbVeMNlFKR3/b04gGUiT bClkE+hnLWgDfQGY229UlKDA4DC0pu/Iq0yDc0SmjQZcRbEmjzC5MnBcn/JR/TO1dWNI M5UA== 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=SMV12gvgXWyti1wWozncOBF2sC/NzCwG5tM1W9vYuH4=; b=cvSbbpl4zAMSLedbwYtcU53l6KAwbhdv7W4El/a3bsrRDYN9+SknazYfMAnP7O7exf xkg7zix7Lju2ISXwVlmajoTRXEeTJxfFEulZ4YIU2FuShJMt7KNkMA3GWWzxwIpMTyEo lwpNAeyTqXvPQL/R9w9hBKShjo/wVvQfbRfhgs0zVVLhfAJ+74f6eBJbf/sWDmcK4V0K 5nz7OYnBT46gdtFh/dNn/GHF3oPH9D0VvrOfCi/ptlscfwRC4RitpbAS0oog3r+TwWBX I4S1TrXM09uWjUGB3fpRJJzX3lKNjEOFklUTRpr1wBjJuQKGE+siIPS9RMo1fJVQ+l9B mFUA== X-Gm-Message-State: AOAM531FbK5M4oVTXGvTAxVLS9KxM/GKjJrh0LDbEGGzqNPIj0p60BWi +fg2055SL42puIxl43tPSmiDzXBsAQxVy8QQ Sender: "andreyknvl via sendgmr" X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:5f45:: with SMTP id t66mr315013wmb.20.1605046831528; Tue, 10 Nov 2020 14:20:31 -0800 (PST) Date: Tue, 10 Nov 2020 23:20:05 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v2 01/20] kasan: simplify quarantine_put call site From: Andrey Konovalov To: Dmitry Vyukov , Alexander Potapenko , Marco Elver Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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 2bb0ef6da6bd..5712c66c11c1 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -308,7 +308,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 21fe75c66f26..c2c40ec1544d 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -214,12 +214,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.222.g5d2a92d10f8-goog