Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2704415iog; Mon, 20 Jun 2022 02:56:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGTan6lqZwm1NBUQz60r3oEfSxAYfqKmXj147vx73vKP8AMI65Z6s04jWNX1x/Bd4alqgn X-Received: by 2002:a17:906:b1cb:b0:716:89ce:a708 with SMTP id bv11-20020a170906b1cb00b0071689cea708mr20022235ejb.667.1655718986404; Mon, 20 Jun 2022 02:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655718986; cv=none; d=google.com; s=arc-20160816; b=OElid87s+PUn6z7zPSWnbwKkG69d5/KtnH8cpBaaQh9VMwPfKmi7GmmDY3sZk3mCPR rVt4joXOWdrg63NqHAfvnWlXoFC3J5fuqEzItIE0mprv0cTSUih8FBIjh8ZuaO2Wd9aS NvBZFodUICOAMUqLcrnUXWPxmWnX9boeg6R4U05g2zzWbvxdzcntOhESXu74fhDROhpl MmTwfJ2s3ANSpkEnr0y/6+mSv5f4ZvDwhIz7l3eGeUzZOK7yvTeqa5/Xkp/vspCVUAlY IdaO5f5k9SBIRG+gvOsoIL5MuZ1MqFoxZcTn/F5uYMYEKiFX+XwNvMm4Jlh8XgCs8iZz EumA== 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=/5XQWxUT78CJ9q4IKK57xGusAoxHrjt7w5b5bQek9HA=; b=R63YyLEH8PjPmkkSljq7098GrF9RKRCaY6X/ho0dyBZ54piU2VB9i+kv+7aYmMvbSB 7KbntS9SZlcMcolO2zq6r2vMeitNgxz2SRdcwgkSDUUbWX7rISH8+Du6n5oK0OWIPq0d tJJmUSAqu4F1k6ZFPmTml6xCv0R3buizAH5uN8u2doz5pL2lzq9yNiQwx4IPnLkGNNSm z95gM/CttKPUiyCDaV9itfafchSvQboSgKedofKQtLU/D33xwoMDIB6YLoenbOfHArJE smUXqO1hiSPRbT74PttDBrBkE1lGSlpFSdpxe0ifyWMFhMnLuR3Z0Rgh433iEsGSLxKU AGaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HeTIwbsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170906474400b00703e424d757si8306957ejs.400.2022.06.20.02.55.59; Mon, 20 Jun 2022 02:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HeTIwbsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S240118AbiFTJyb (ORCPT + 99 others); Mon, 20 Jun 2022 05:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239833AbiFTJya (ORCPT ); Mon, 20 Jun 2022 05:54:30 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A17513E16 for ; Mon, 20 Jun 2022 02:54:29 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id s1so13876480wra.9 for ; Mon, 20 Jun 2022 02:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/5XQWxUT78CJ9q4IKK57xGusAoxHrjt7w5b5bQek9HA=; b=HeTIwbsdqxTlA6dnJyf7K/MPvYGDs+ekgNBGuf/QI/nMpkPVYE/lzCyvyLrzqiUlIi YGN8SG5jr5aCTedEE5DrZ0AQ9cStZmCYIs5+FDtef0xGw57/QYpSn7teIYN7Bsxz6kco ZgFFHAlBfzUHox6+rXb20NTfCJ6d8c/en1GKc4GhrlsERxjMsYLYV5dUYlfCYmiqGbkl LvMrADI2Y1du47q5PLoR7vEUvV131eHlDe3CgaeK6u+xz6THfV3bHIZZzc1xZfpjew3w Vsho5v7hLodwpKyGgoMt7eQnmR/3tJH8RuTXyHcTlUNAjELbiPEQN14td7jsvPX4aruE 202w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/5XQWxUT78CJ9q4IKK57xGusAoxHrjt7w5b5bQek9HA=; b=1JgVsIIdmI1AJ9UXSKrqAEcL94osiyFB5KD2wXCFjXeoMsIr7Tfc0wSu+XizR4zA8h b24/WtWQoy0ozrzmiMxvba7CIAnxRSbs4Kr6QY0DEcQiKSg2jtgG91K+0Y3Hjm7HxVaf X7j7khR6l1aiGQMFnRk+EZ9Bs34iFtbNorD1uEbICamk6IcgLSgrk0vmtuQZORwF67v3 A3XH1cWNAsR+CI4gbIbdcP2PzfACWD9y2jgcjsD3U4EuP/ypj/lwRXm4t/D83TT0Dub8 PmnqYNtu9wk/XmhPzpBSOUcW2yXkR9tF7A/80R7h3V/1cqp2pHR1ywpqgjKk2kSGGmmf 1PAQ== X-Gm-Message-State: AJIora9GgqxQm8tPIKx3Nmch2hECFraOZXgzbPTBZiRCzHHKzRLR/4UC Azg4yEnd0L7co4kIcEmf4OVwCw== X-Received: by 2002:a5d:47a7:0:b0:218:5a5d:6c55 with SMTP id 7-20020a5d47a7000000b002185a5d6c55mr22074873wrb.192.1655718867517; Mon, 20 Jun 2022 02:54:27 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:3746:a989:7595:e29f]) by smtp.gmail.com with ESMTPSA id z6-20020a5d4d06000000b0021a3dd1c5d5sm10312787wrt.96.2022.06.20.02.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:54:26 -0700 (PDT) Date: Mon, 20 Jun 2022 11:54:20 +0200 From: Marco Elver To: andrey.konovalov@linux.dev Cc: Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH 19/32] kasan: pass tagged pointers to kasan_save_alloc/free_info Message-ID: References: <9363b16202fb04a3223de714e70b7a6b72c4367e.1655150842.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9363b16202fb04a3223de714e70b7a6b72c4367e.1655150842.git.andreyknvl@google.com> User-Agent: Mutt/2.2.3 (2022-04-12) X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2022 at 10:14PM +0200, andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > Pass tagged pointers to kasan_save_alloc/free_info(). > > This is a preparatory patch to simplify other changes in the series. > > Signed-off-by: Andrey Konovalov > --- > mm/kasan/common.c | 4 ++-- > mm/kasan/generic.c | 3 +-- > mm/kasan/kasan.h | 2 +- > mm/kasan/tags.c | 3 +-- > 4 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/mm/kasan/common.c b/mm/kasan/common.c > index f937b6c9e86a..519fd0b3040b 100644 > --- a/mm/kasan/common.c > +++ b/mm/kasan/common.c > @@ -227,7 +227,7 @@ static inline bool ____kasan_slab_free(struct kmem_cache *cache, void *object, > return false; > > if (kasan_stack_collection_enabled()) > - kasan_save_free_info(cache, object, tag); > + kasan_save_free_info(cache, tagged_object); > Variable 'tag' becomes unused in this function after this patch. > return kasan_quarantine_put(cache, object); > } > @@ -316,7 +316,7 @@ void * __must_check __kasan_slab_alloc(struct kmem_cache *cache, > > /* Save alloc info (if possible) for non-kmalloc() allocations. */ > if (kasan_stack_collection_enabled() && !cache->kasan_info.is_kmalloc) > - kasan_save_alloc_info(cache, (void *)object, flags); > + kasan_save_alloc_info(cache, tagged_object, flags); > > return tagged_object; > } > diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c > index f6bef347de87..aff39af3c532 100644 > --- a/mm/kasan/generic.c > +++ b/mm/kasan/generic.c > @@ -500,8 +500,7 @@ void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags) > kasan_set_track(&alloc_meta->alloc_track, flags); > } > > -void kasan_save_free_info(struct kmem_cache *cache, > - void *object, u8 tag) > +void kasan_save_free_info(struct kmem_cache *cache, void *object) > { > struct kasan_free_meta *free_meta; > > diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h > index 30ec9ebf52c3..e8329935fbfb 100644 > --- a/mm/kasan/kasan.h > +++ b/mm/kasan/kasan.h > @@ -308,7 +308,7 @@ static inline void kasan_init_object_meta(struct kmem_cache *cache, const void * > depot_stack_handle_t kasan_save_stack(gfp_t flags, bool can_alloc); > void kasan_set_track(struct kasan_track *track, gfp_t flags); > void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags); > -void kasan_save_free_info(struct kmem_cache *cache, void *object, u8 tag); > +void kasan_save_free_info(struct kmem_cache *cache, void *object); > struct kasan_track *kasan_get_alloc_track(struct kmem_cache *cache, > void *object); > struct kasan_track *kasan_get_free_track(struct kmem_cache *cache, > diff --git a/mm/kasan/tags.c b/mm/kasan/tags.c > index 4f24669085e9..fd11d10a4ffc 100644 > --- a/mm/kasan/tags.c > +++ b/mm/kasan/tags.c > @@ -21,8 +21,7 @@ void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags) > { > } > > -void kasan_save_free_info(struct kmem_cache *cache, > - void *object, u8 tag) > +void kasan_save_free_info(struct kmem_cache *cache, void *object) > { > } > > -- > 2.25.1 > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/9363b16202fb04a3223de714e70b7a6b72c4367e.1655150842.git.andreyknvl%40google.com.