From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54BA4C433F5 for ; Thu, 21 Apr 2022 17:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390795AbiDURcR (ORCPT ); Thu, 21 Apr 2022 13:32:17 -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 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