Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp472984pxb; Wed, 11 Nov 2020 08:13:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGpwD5FPRnqWnLAKQ/xuflacTroNQ8PwSp/oo5Pdpn5Za05WMiuwXev9uE+FeFTn15cg0N X-Received: by 2002:aa7:c40b:: with SMTP id j11mr117848edq.151.1605111187974; Wed, 11 Nov 2020 08:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605111187; cv=none; d=google.com; s=arc-20160816; b=rkc/JdKkxbCMIvE9+7NnL8qWMUNhFZpqL300lNuxAr6Nt3RnDdxmNMrCnZYJKtdsnp E8mDpM2rYAKcrZ/nj2HVSXVtoYmkTVjR0EtOEVQ49Uc4+yq2OHYmLatwmrHQb07fsDD8 6qijm9irgcB/jNR8NVyZ6WNi+VIX/ZfJVme+0wmgglS5ntAe7m215UdaM9S6srTYKVrn Okj4zgU8AST753WZ/pEgmvUBcoPczF79Cb8xDMzwO2Gs/69B+ThwPIGIPkSbHkLzr89L Sqr1k9oO1uxdF2dVQ/SmQ3jN50kbzfXMl5N2I1Sa7b/UaGQW73QzQ1wlKnXn9vrHEZh3 lXKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=u6Xd/aWnBK+33C9vA03cmc0xfNfCQ2wQSEufKCfSLLc=; b=A6XwrHyPouhR0GJ/lJe9kcL8Rv1ahLPXaop8PISpcoSorjn96dnDFoU/W4kFg7ZN6S EoHeZyEZ/m+OMOo0rGp5QzvHtTeZNAQe5QSde7/f2Vo1NCMvVs9SdIgnlDgQbrnoR31X RP7OYiVgcn+pH97R64flWhSUCY/zAiRAGdj49RedVnEPewxoAc4+uFVoNLFkxnl+7cip FJsb/Y1sy15uPH2gbACbzVtJ3O/FKWp+4zExOcz4RGRXFw7DW0x4onTKfeAuvLV/Pymg xMhbk6AcWxw5q8BtLTc3sTMyGXYqv480cf9Dk89QuLjO3v9aw9lXlDeENepXzpnV0aXb N4TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=S7eIjQJs; 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 c25si1795152edy.364.2020.11.11.08.12.45; Wed, 11 Nov 2020 08:13:07 -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=S7eIjQJs; 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 S1727279AbgKKQKc (ORCPT + 99 others); Wed, 11 Nov 2020 11:10:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbgKKQK3 (ORCPT ); Wed, 11 Nov 2020 11:10:29 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 224DFC0613D1 for ; Wed, 11 Nov 2020 08:10:29 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id j7so3072533wrp.3 for ; Wed, 11 Nov 2020 08:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u6Xd/aWnBK+33C9vA03cmc0xfNfCQ2wQSEufKCfSLLc=; b=S7eIjQJsoE5u9wPV9toq8jRiNhUQI3htGOSx8qUpkqR4BGLJRnQr+4x0Q4C0jbYqp2 j1AS4li5L6Zbgn/O6bkqXpl3IrUhfW4fM0+xLQq6hyiBSFdHCYDE2XHU91znp4goXKvS EnB028EKIaLTEO5BOnGWZj5kpj7BUeQ5BEhlXzBaNTzdYAxK3uheaTyrpwTIE513EOz4 jlXFggVxGCRzgwfvoExZ/3pE+dQsiFQZwlMsrBfof7DqYUbXTBADuj3OYAywwXF1JJt1 CMQ6r5GBXsqa5eWpLEdcoegrHB9aUiIKtv0xnX971ZC4VGwHHqFrynLHOT6KDFJuSHXm 95mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u6Xd/aWnBK+33C9vA03cmc0xfNfCQ2wQSEufKCfSLLc=; b=lYB/TTwPU4HP82Whcmq3BXEhBojwCmDNUToEkIEKO1j6fZBSGWJVc6948aBH2Q33mw JiaRztXu5E+TiJqWeQh+s9DCrOlK6YnS0U6vqMVuyDWVHfFgwFV3ga+JPdbdpAMBoB6+ KNbSeq1P+lywncGpXgFpIRqBJZWzgwPV5jCKZZ9ciWutpf+9ffC5JB7+NRsmP7xQ1kq4 fqW9KqKIQ5q4uQ4elWt6MA3kCPzq93jQMcqw2HfL1xVG3vIg8j07aI8tdmSYpqSSzeDn /qUdC6hp7N39x6/F0LipW+RIz84sz45AxZ9mJHk4gy7AGHJQAE07bqqw6yyoBNglgN4h gY2g== X-Gm-Message-State: AOAM532eTyAwv0RQtARm1/wI47ujx0G9TFiov2Kr90vXmkkrw4FBgmPZ h8FKzXwhjv5Vby6qvXfvvcihYw== X-Received: by 2002:adf:f90f:: with SMTP id b15mr31148545wrr.343.1605111027687; Wed, 11 Nov 2020 08:10:27 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:f693:9fff:fef4:2449]) by smtp.gmail.com with ESMTPSA id h62sm2946698wrh.82.2020.11.11.08.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 08:10:26 -0800 (PST) Date: Wed, 11 Nov 2020 17:10:20 +0100 From: Marco Elver To: Andrey Konovalov Cc: Dmitry Vyukov , Alexander Potapenko , 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 Subject: Re: [PATCH v2 03/20] kasan: introduce set_alloc_info Message-ID: <20201111161020.GE517454@elver.google.com> References: <5302e6d48429465259bd0868a7dc357290a2e8a5.1605046662.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5302e6d48429465259bd0868a7dc357290a2e8a5.1605046662.git.andreyknvl@google.com> User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 11:20PM +0100, Andrey Konovalov wrote: > Add set_alloc_info() helper and move kasan_set_track() into it. This will > simplify the code for one of the upcoming changes. > > No functional changes. > > Signed-off-by: Andrey Konovalov > Reviewed-by: Dmitry Vyukov > Link: https://linux-review.googlesource.com/id/I0316193cbb4ecc9b87b7c2eee0dd79f8ec908c1a > --- Reviewed-by: Marco Elver > mm/kasan/common.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/mm/kasan/common.c b/mm/kasan/common.c > index 8fd04415d8f4..a880e5a547ed 100644 > --- a/mm/kasan/common.c > +++ b/mm/kasan/common.c > @@ -318,6 +318,11 @@ bool kasan_slab_free(struct kmem_cache *cache, void *object, unsigned long ip) > return __kasan_slab_free(cache, object, ip, true); > } > > +static void set_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags) > +{ > + kasan_set_track(&kasan_get_alloc_meta(cache, object)->alloc_track, flags); > +} > + > static void *__kasan_kmalloc(struct kmem_cache *cache, const void *object, > size_t size, gfp_t flags, bool keep_tag) > { > @@ -345,7 +350,7 @@ static void *__kasan_kmalloc(struct kmem_cache *cache, const void *object, > KASAN_KMALLOC_REDZONE); > > if (cache->flags & SLAB_KASAN) > - kasan_set_track(&kasan_get_alloc_meta(cache, object)->alloc_track, flags); > + set_alloc_info(cache, (void *)object, flags); > > return set_tag(object, tag); > } > -- > 2.29.2.222.g5d2a92d10f8-goog >