Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp887856pxb; Fri, 22 Apr 2022 13:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMatpW1IYRLseWetCFxFFo6NBecOpb5M59lzXgWA0rbDc5iuhMlsz6c2VsXZGdqQ+KJ0xc X-Received: by 2002:a17:90a:aa96:b0:1cb:c57f:9218 with SMTP id l22-20020a17090aaa9600b001cbc57f9218mr18217201pjq.227.1650659374344; Fri, 22 Apr 2022 13:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650659374; cv=none; d=google.com; s=arc-20160816; b=qd21+PpcBYPZVbxx6WiVc1Lp1lFjxuGdGM1l8ialrdh+zNHFslIINZkOqTjK//aTKZ NgvkdJUiFxQK2B1fYewmnSx+3W38aJ5Zgk/dJGauqzGlTU/SR1R7OvI06uSi11lrbZ4K w2fDi5f1nWtGkui6QWvrwPqFc+PnR79pTgUrbjDdPiWF+rin9TwIYijhBhR6inoLtu54 9q4nDtnCActwq5DeWOwUuqEOUkbEgbWuiyRl6DQmTy/PJi15swxCTXHiSvHRCuEKPMCA RNrMbgfJZBnfplRGmnqB/0QFWsZt9sKKmx2EKRIfaW1GxA2wp1cz3q1bIS0RolYssC47 c4mA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e9DZ+W1tXa8dFqgf2097OZ0qGTRPNdwwslU5YUVe0Xk=; b=jeCi4mOUxDA3Ou9pLhoS+BZEqDJOuPiKMb3PmzxxxBQynMnKwcUr5kpNEez59F2S5f LFqlmX8WHUalYXQjR3EiF+wddTuEOdhoFD9r8P5nUqDBK1CE899sioCEW1bAJJV7YHdk 1d0gWG8aTJloidHS05Q/Qfw0VPsyrdyA9xUAsbhL+e7x+wZWmnjW1V7Hux4vQt3jVDTK ulG/E3LhBvgWPQWwHOzYRLL+wy0hRNASh7pY98y0/sh+J9Gmo6MbJ+tiR40gEbcGgiwv N/E0h33Tedbc91x/cipEJvxekBTxGmwXUu/7/OgrdeiIRtt+Ji7Z34Ib/0+zim2UckdZ YKNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THxi+4+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o6-20020a170902d4c600b001567d82c09asi10285074plg.174.2022.04.22.13.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:29:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THxi+4+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 62EBA1B6424; Fri, 22 Apr 2022 12:16:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390788AbiDURcQ (ORCPT + 99 others); Thu, 21 Apr 2022 13:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390780AbiDURcP (ORCPT ); Thu, 21 Apr 2022 13:32:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F0E0E48885 for ; Thu, 21 Apr 2022 10:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650562163; h=from:from:reply-to:subject:subject: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=e9DZ+W1tXa8dFqgf2097OZ0qGTRPNdwwslU5YUVe0Xk=; b=THxi+4+HEiHMwOja0WYcCxsRzsKI6xbw28Hj3DjwpcUHgmyn2SwyUBkkEPiXCpBeZjRW9M Zq0ZhoKIMsXFvTXSlAe6gqJfOG4aK8prBzYffup8OeV/CRPoRisfK1YsE9SlKLaW9ZQhEb MNtYMEtbsZ5Xrmd11M4Lsfo4xTffGUg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-tnkI7wWFPTSa6b_M4Jj5jw-1; Thu, 21 Apr 2022 13:29:18 -0400 X-MC-Unique: tnkI7wWFPTSa6b_M4Jj5jw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1358C800B28; Thu, 21 Apr 2022 17:29:18 +0000 (UTC) Received: from sparkplug.usersys.redhat.com (unknown [10.40.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FAE29D61; Thu, 21 Apr 2022 17:29:16 +0000 (UTC) Date: Thu, 21 Apr 2022 19:29:13 +0200 From: Artem Savkov To: Daniel Borkmann Cc: Alan Maguire , Alexei Starovoitov , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH bpf-next] selftests/bpf: fix prog_tests/uprobe_autoattach compilation error Message-ID: References: <20220421132317.1583867-1-asavkov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 Thu, Apr 21, 2022 at 06:53:22PM +0200, Daniel Borkmann wrote: > On 4/21/22 3:23 PM, Artem Savkov wrote: > > I am getting the following compilation error for prog_tests/uprobe_autoattach.c > > > > tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c: In function ‘test_uprobe_autoattach’: > > ./test_progs.h:209:26: error: pointer ‘mem’ may be used after ‘free’ [-Werror=use-after-free] > > > > mem variable is now used in one of the asserts so it shouldn't be freed right > > away. Move free(mem) after the assert block. > > Looks good, but I rephrased this a bit to avoid confusion. It's false positive given we > only compare the addresses but don't deref mem, which the compiler might not be able to > follow in this case. > > https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=6a12b8e20d7e72386594a9dbe7bf2d7fae3b3aa6 Right. Thank you for fixing up the commit message. -- Artem