Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1070256rwl; Sat, 25 Mar 2023 17:16:23 -0700 (PDT) X-Google-Smtp-Source: AK7set/Vb6LBGed/RIPdQgM4BGbh9UHXJJLhfrVSg2xNpCmIcZb3Oy69aSXnnD7zVP3ny64yTUZS X-Received: by 2002:a05:6a20:2098:b0:d0:61ff:8535 with SMTP id b24-20020a056a20209800b000d061ff8535mr7485918pza.4.1679789783420; Sat, 25 Mar 2023 17:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679789783; cv=none; d=google.com; s=arc-20160816; b=fhJOyBy4PrlzihMmiG9t9mopiESUw3hz8wioH3Gx0HaRsm/81LpZ0Hc668cuEwJWRc 99JnosPw+kxTHkFdICE6EqrXhC7pqFc4B+UXCOBh4a/8Xc3x62bWI82FptmCWBOMOsR+ zymhCZgDBAIrFipIwQARd4hQiMCrd7fvWuWcvkdMNEbGhGtaKq2XSoVjAPa+fgRS4dxD fvWSysErGytc1GwXweOd+6vAjMp/F0i6VPz93gkJx6HC2WzWsLEGZO60gv39df1JcwA4 QDA1VHQT5IFq4XICTa2+RnuiNF+1JXEiscSOvi5JPtmqV0xMasWVL4DodkzPj0Qp0wJh GzEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:date:message-id :from:subject:content-transfer-encoding:mime-version:dkim-signature; bh=0h1l0pdDo36eSHz6Ua2aOwYg1YMF56DYyhceOho2hv8=; b=OpK74vQO1okKMeUVCVbY2H400U17jbRdZfP+eeP5eJNEGNiugcKV3D9kvpOmyKEveu N60gHoJMyw3HpdGuTIcC+qCCh5mBgE4St7KF1uq3tdr3mKP5PZYN6pXPLm1wcj6horBD B6EAVyeymZ4I5cbuhssU8aZUK80o/bZVt7eiYy/JcXsD6MFY38DRPJ+GZEguZ1jZNsYa 2C9dfxqYEl+ifDqXntJqp7CEnCqrNPY5DmGg7erHp4OYsnR2HvCtlXqIi+z3ZSFtcHwE 3e1Fp4pCjyz5WVHBQd2DO23HmVpCgHbMP7QskBNNROS8zs86rgPLg0TaaCAMC/JmGtRx JIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S0e+t1Bl; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fa16-20020a056a002d1000b005b9a30ee5a4si24692457pfb.116.2023.03.25.17.16.08; Sat, 25 Mar 2023 17:16:23 -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=@kernel.org header.s=k20201202 header.b=S0e+t1Bl; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjCZAMS (ORCPT + 99 others); Sat, 25 Mar 2023 20:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjCZAMR (ORCPT ); Sat, 25 Mar 2023 20:12:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A49AF1A; Sat, 25 Mar 2023 17:12:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3095A60DE3; Sun, 26 Mar 2023 00:12:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 7C4B8C4339B; Sun, 26 Mar 2023 00:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679789535; bh=eFp8h+lyyQAeLgWNpEKwDJOlkXJNNVleOesWRSSHbpg=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=S0e+t1BlWlnS3OUiQiXB7XegEwyhUCnk5/f3IUAZsKn2rjGmQazIUN+8J2UB9NQLZ kSMELD1OqBBLWRnvp8+H4swtT6Nq116Rt8IMCFXIXaqbUP7GBIqRaOG84bPtKar06o +4ixZXtSEL/Grn/wwlyOyWzsYJzVUPjChcetSUTpTiNODkWg+OgQQtSjf+xJ5ofK2V k3Y+fS+6aNMSBS9oA2Xd2+OAQ5hH2VSiL5EDzAZJ8x/NKquObJfeF1mCYCOiHk5taR Fn/g1dcrMfOupM0mIOEYB8m6ZlzB0RzkPQRvY3162FzMF8NnJtuCel1zJOef7gps7O 7jq9jjOD53lQA== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id 614E6E4F0DA; Sun, 26 Mar 2023 00:12:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH bpf-next 0/3] Don't invoke KPTR_REF destructor on NULL xchg From: patchwork-bot+netdevbpf@kernel.org Message-Id: <167978953539.24849.6734848364583344239.git-patchwork-notify@kernel.org> Date: Sun, 26 Mar 2023 00:12:15 +0000 References: <20230325213144.486885-1-void@manifault.com> In-Reply-To: <20230325213144.486885-1-void@manifault.com> To: David Vernet Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov : On Sat, 25 Mar 2023 16:31:41 -0500 you wrote: > When a map value is being freed, we loop over all of the fields of the > corresponding BPF object and issue the appropriate cleanup calls > corresponding to the field's type. If the field is a referenced kptr, we > atomically xchg the value out of the map, and invoke the kptr's > destructor on whatever was there before. > > Currently, we always invoke the destructor (or bpf_obj_drop() for a > local kptr) on any kptr, including if no value was xchg'd out of the > map. This means that any function serving as the kptr's KF_RELEASE > destructor must always treat the argument as possibly NULL, and we > invoke unnecessary (and seemingly unsafe) cleanup logic for the local > kptr path as well. > > [...] Here is the summary with links: - [bpf-next,1/3] bpf: Only invoke kptr dtor following non-NULL xchg https://git.kernel.org/bpf/bpf-next/c/1431d0b584a6 - [bpf-next,2/3] bpf: Remove now-unnecessary NULL checks for KF_RELEASE kfuncs https://git.kernel.org/bpf/bpf-next/c/fb2211a57c11 - [bpf-next,3/3] bpf: Treat KF_RELEASE kfuncs as KF_TRUSTED_ARGS https://git.kernel.org/bpf/bpf-next/c/6c831c468412 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html