Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp96140rwb; Sun, 6 Nov 2022 03:15:28 -0800 (PST) X-Google-Smtp-Source: AMsMyM6bKQ4hpvm/p7jEU99tPLX82gL7eMiKh1ILREjrsGvy2JMkdmGooMml3FL626eH/DnGWDjU X-Received: by 2002:a17:902:70c4:b0:17c:f9fe:3200 with SMTP id l4-20020a17090270c400b0017cf9fe3200mr45594224plt.1.1667733328207; Sun, 06 Nov 2022 03:15:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667733328; cv=none; d=google.com; s=arc-20160816; b=tKR5YLKUnyJdT+yxpZGJBtK5GX9+ccV645pqS3HCJmxTCkDTn6a+dpwUd42N75bQK6 VbI5xRWbGfOqyhwhUn12wiShU58N6UihDNV0a6wkNr4lT+NgQ6MWcA9QyQfJOaxfSFxk 5QV8Lf4x5VTjVOPc6ngXXtZ0W5lQTLcus6a9jutiOlay2aH3CEGeIcAXYGE5MMtlE5+k JcH4UBBK5MV1D1odPAIHjkCq5E/PhwZQBa/Mm4TG9/6ChoyF47BZ2FxZ/AOH5CVDlKQp knXyjucliHMzWFs6QDkAAIUiSm45GpmG0CBMJ//usISlamAI5x6hSfXSUDA3hZ3FLA3b +bkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d/7LW7lwY8oZ4ACHiAH4Aswn0e1LYPuf1ESlWFt5AVg=; b=TEeCGsMzLesRpoAmHdwPzLdgqksqz66jwtLIiSDDg1IOknXHVt/ljQa+zk+3c4Elfq lEsNuV8aMUvM1+EqGKU3VhZEj4cj0WPA37PHWWpGyMzSC+KnPES60pzXlpHAz9WekAdx jI69k53jMv56DLZnamWah44R8rQ/hKze0KQoo3DfdEXesZfxnTXsQM1lvhKLx6O3vi6m Em7xkHbFuKZ5XIP2f7tR/PPuO5p97Zw3wCqc/EEhZNuBj/5mOezEDvxYvFSG1plM3XyY ZLTiZ9KuO39Eu6hRFfZwHriQHE4Pg3RUtEHLdPAYIf+Tb2b6t6SeSnD+eyw2hQxwDOep V6+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nGhCIFW5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a632b11000000b0046fef65f738si6026470pgr.793.2022.11.06.03.15.16; Sun, 06 Nov 2022 03:15:28 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=nGhCIFW5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbiKFKqZ (ORCPT + 96 others); Sun, 6 Nov 2022 05:46:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbiKFKqW (ORCPT ); Sun, 6 Nov 2022 05:46:22 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE7F65D5; Sun, 6 Nov 2022 02:46:22 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id f5-20020a17090a4a8500b002131bb59d61so10558444pjh.1; Sun, 06 Nov 2022 02:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d/7LW7lwY8oZ4ACHiAH4Aswn0e1LYPuf1ESlWFt5AVg=; b=nGhCIFW56DbH4ofS1cJb2PSk6GRFIeO3+Dhzi7S7NMo9WOgBAaEeYy11wNWusqx4/l xTOfj+ervuzKxBafkF/oN71uqUlyWrrfHOtmI0TeIuWfCaS38HCyBxXdx4drjJrqWt7G vgW2kUcjSdW2M84phs8EebVg5DmLpoXgCmGxXGCWJcSHsJBB0/wc/QP65kuDDkBxYmPI Ho4A0vgbfiSbLqa/9GGeJJ7xfwTz1ybvlqSnmv9tohjZrdTRm2+VYbDBXRPz22Yk4bE4 cL8JzsGXvou28PTOXMFQjAFwgZl3PfMjicMhJwUarlPxxfo87L2JmOhVZlhKpylgOb/Z EYOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d/7LW7lwY8oZ4ACHiAH4Aswn0e1LYPuf1ESlWFt5AVg=; b=2vuJ7+pQ2tYXxITwz+EZDNvtuwuG8+kg1OQaagEWFS2wTmU8Fr7IB9ZeVgJiIoWGUQ Rp5RhiDWJhKE7tLJkNxdQU+0XNyLhtCLs0xdCTDIkIAKV+vrtBDlPQBDS0zfdIDxTgdw +WMX/htJITbWNgRkBDr31aWGWEThONV86Q5h+U6nyhD3H5y2/fQQ7XT2PT3RiqI3uoMX g41G+4VapmGKsUNnqj3cycwqyyHQ9mP703HN37P1CjkGI5LbtXRK+e001lS8mslAj1EJ O0ptxcOFqjh5oIQczRDY/jDID1c1MEUON46UKEzPO/Lb6Eyb+sGCdBkJk7GY06BgKTFj Rwag== X-Gm-Message-State: ACrzQf1Qzaepx+8joT2dXgZlTrGc0LKRyzqDNHr5c+ySmiJt4UiU4Er4 6of4I0PbMBx0bmbrSxShGWA= X-Received: by 2002:a17:902:7897:b0:178:9292:57b9 with SMTP id q23-20020a170902789700b00178929257b9mr45547569pll.102.1667731581663; Sun, 06 Nov 2022 02:46:21 -0800 (PST) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id a11-20020a170902eccb00b00186b7443082sm2923018plh.195.2022.11.06.02.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Nov 2022 02:46:20 -0800 (PST) Date: Sun, 6 Nov 2022 19:46:15 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Kees Cook Cc: Vlastimil Babka , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] mm/slab_common: Restore passing "caller" for tracing Message-ID: References: <20221105063529.never.818-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221105063529.never.818-kees@kernel.org> X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Fri, Nov 04, 2022 at 11:35:34PM -0700, Kees Cook wrote: > The "caller" argument was accidentally being ignored in a few places > that were recently refactored. Restore these "caller" arguments, instead > of _RET_IP_. > > Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > Cc: Vlastimil Babka > Cc: Christoph Lameter > Cc: Pekka Enberg > Cc: David Rientjes > Cc: Joonsoo Kim > Cc: Andrew Morton > Cc: Roman Gushchin > Cc: linux-mm@kvack.org > Fixes: 11e9734bcb6a ("mm/slab_common: unify NUMA and UMA version of tracepoints") > Cc: stable@vger.kernel.org BTW I think it can be just sent to next release candidate. The referred commit was merged in this development cycle. > Signed-off-by: Kees Cook > --- > mm/slab_common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/slab_common.c b/mm/slab_common.c > index 33b1886b06eb..0e614f9e7ed7 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -941,7 +941,7 @@ void *__do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller > > if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) { > ret = __kmalloc_large_node(size, flags, node); > - trace_kmalloc(_RET_IP_, ret, size, > + trace_kmalloc(caller, ret, size, > PAGE_SIZE << get_order(size), flags, node); > return ret; > } > @@ -953,7 +953,7 @@ void *__do_kmalloc_node(size_t size, gfp_t flags, int node, unsigned long caller > > ret = __kmem_cache_alloc_node(s, flags, node, size, caller); > ret = kasan_kmalloc(s, ret, size, flags); > - trace_kmalloc(_RET_IP_, ret, size, s->size, flags, node); > + trace_kmalloc(caller, ret, size, s->size, flags, node); > return ret; > } > > -- > 2.34.1 Thanks for catching this! -- Thanks, Hyeonggon