Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp718557rwb; Sun, 6 Nov 2022 12:37:54 -0800 (PST) X-Google-Smtp-Source: AMsMyM5nDDpD7BIaX2k3pOZCg7Sb2qqRD9LWzJybHyWneHdSW6ThWuwRo21DeF2i7syo7V7izsfh X-Received: by 2002:a17:907:7639:b0:79f:d1dd:2f86 with SMTP id jy25-20020a170907763900b0079fd1dd2f86mr45434749ejc.586.1667767074265; Sun, 06 Nov 2022 12:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667767074; cv=none; d=google.com; s=arc-20160816; b=I5J8RiFTtTvrybnT1OQbqmIBkFJ8VHX++6tA7ONzla3Q6BS915Km420lQUTBgw64o9 Ds4hsNhG2m1pqYi/5cjYXeg/+4oMejJ8O88+cSyJo60PDhsqh4TirS3hZqf6W+xZinvR J0GKmwU0BUuZDaTNxE06vdyC27CUu30uU8DO3YPh6AN1TLhwKVs1FCdjJQxUn9d9klC2 oaV1cc8n42okIfZdMXHiIJEpv02PSa5GDp3nyKTQg/UI/S8nMj1spg/HOXrI0s1sYz5G LJabkaG7QDnZcTd8RhwiIUKmrEmzjGcXB6rSGPwCFGwib0LEOE/P1vaSC9laPUHvwqSe wmOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=pIZQvJkOXMu5f5ncgLVznHSCKNS/Jviq7uNbN/RW5Bo=; b=qViH+RgGdreMgk+tyE2rNhjsMJgklKOtNJWWT3cvla71DipSZyQ3ZwlaMsigI8Oqx8 gONiAX0p9sv7QkH19/FPw7+O2qhDUoUodDYZjhZcvI+is6NSdUYgMICE3ADvppxgP2Dm 8t33vlJnwrnbZEL0RPg4h+YsyjcseA4BbO3UmBzUUnZ5d52qEa7sL/bT8tR2ZWeP7VUb RXazgWYoLEEJmYFFtKVK6JJmgmcud/Ouy9myZbubt5w9pLY9lBxQ+b0/IwtibQGnB5TL d7wixUc65aJoIF893Sub3pyh1waMY1r4MO4tJMjhjyhCBOacRtGEYQ+/+AO1J90xVtdF 33Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=FuTiZBSe; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=B8Y8sZPe; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a170906684d00b0078d112eaf80si5078281ejs.86.2022.11.06.12.37.30; Sun, 06 Nov 2022 12:37:54 -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=@suse.cz header.s=susede2_rsa header.b=FuTiZBSe; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=B8Y8sZPe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiKFUYE (ORCPT + 95 others); Sun, 6 Nov 2022 15:24:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiKFUYB (ORCPT ); Sun, 6 Nov 2022 15:24:01 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 985D111440; Sun, 6 Nov 2022 12:23:59 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1897D21EC4; Sun, 6 Nov 2022 20:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1667766238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pIZQvJkOXMu5f5ncgLVznHSCKNS/Jviq7uNbN/RW5Bo=; b=FuTiZBSeSwo20pDcxBzlBbULYTF4Fi0Ze9NoVLrAOErRj5OiR2I9jPC7HFZOWeqcRVJwMs 3MAzIy4+ETCetZlLfMIxzEzE7O3OHoeb/cK8uOO3nPsxKp5XkfwpEELC0DVkaHdR37UulO CZemJmItaFTaR7fyHS4I/EBkMRmOVTc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1667766238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pIZQvJkOXMu5f5ncgLVznHSCKNS/Jviq7uNbN/RW5Bo=; b=B8Y8sZPepMIqwwi83F/Y3Ly+9sVinxFhCmNBRE6RWjB17sMX1zGS7lfWyVJeyu8MqY8iPP A/pqKVBucwxxS2AA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CC0E81376E; Sun, 6 Nov 2022 20:23:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8T9XMN0XaGM7eQAAMHmgww (envelope-from ); Sun, 06 Nov 2022 20:23:57 +0000 Message-ID: Date: Sun, 6 Nov 2022 21:23:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] mm/slab_common: Restore passing "caller" for tracing Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Kees Cook Cc: 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 References: <20221105063529.never.818-kees@kernel.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 11/6/22 11:46, Hyeonggon Yoo wrote: > 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. Yep, dropped the Cc stable for that reason. Pushed to slab/for-6.1-rc4/fixes and will send a PR to Linus in few days. Thanks! >> 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! >