Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2957196imw; Wed, 6 Jul 2022 14:51:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sorkb3jjM2s5rqBXX9OgDNUd0EDt7hJ+F+a3xRVqgpB2GrDaI5S7DKRQqa77Hr0P7kfCn7 X-Received: by 2002:a17:906:4794:b0:722:f10e:6240 with SMTP id cw20-20020a170906479400b00722f10e6240mr43133283ejc.704.1657144298676; Wed, 06 Jul 2022 14:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657144298; cv=none; d=google.com; s=arc-20160816; b=FhqAKagh9MFsI17H/pOtOWtvDQLpSoT1av/XVNMTMK4pPxrsRD6ZUWD2uzWph590mo KXiBc6aDt1vpSKTt+myb9sxc6SjlxJA/aR2ZRqOSatjY+rG7xwHyroS1LMQu13iV8nWl fggZV6wBctBPJjkvin+4GxKaUuwIahyEP7adcpgXF6L0MgAQ3yiyqYFPVuqxGoQ6pBSG PTdg2RL8mggAauuzkeAEGB4bzeiozbZrPgJ6VUC6AWx1mRS2uSybJjgJuHpaf4Nv80D7 Slw8D6WHg1dSLbpdW0XAMFHPvz9yDVwin5DVSEVAyf5VXmgxWPRS5eIQDeI8lHiZr7q6 U2Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=+AQ1GpMKjTIzmTJHePG9LwTR5WiUVVBbBf4C8zNXr90=; b=gfhWhaArMU172DoQyYgUin+QIfQ/65EhQpXFQfx6nQVxOxkhAv1DjgKrJKy+kqFrBD Pbq9Af+W00rR/I2K/Be1IoTTWs7jjzZefgyVs/0KGdEPS4f3NqpyqNH5oWFz4QUJ2XXz gnLmfAmpB6vVrqXoSPVVFadVzxod4BD2Vl8GOnXsyq9Vtr43QcsMmxgeMTPXeVH6udbZ ccAeq7nagl+3/KCr/DFdcM75RaC1aTMcCOn3xQl4V0t8BTlU9icmqIQUfgiEpCMkU4ME 1W+M1syCGYjhjfX+Zu/cIu2fleAqoHTWtu2iQRgrh012PH4Ytj3HGtPe6JfrTQD9en9T p7Nw== ARC-Authentication-Results: i=1; mx.google.com; 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 v19-20020a056402349300b0043a7e74dc6fsi7205785edc.19.2022.07.06.14.51.14; Wed, 06 Jul 2022 14:51:38 -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; 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 S234577AbiGFVk6 (ORCPT + 99 others); Wed, 6 Jul 2022 17:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231993AbiGFVk5 (ORCPT ); Wed, 6 Jul 2022 17:40:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6B827FDC; Wed, 6 Jul 2022 14:40:53 -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 29EEC6219C; Wed, 6 Jul 2022 21:40:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5196BC3411C; Wed, 6 Jul 2022 21:40:51 +0000 (UTC) Date: Wed, 6 Jul 2022 17:40:49 -0400 From: Steven Rostedt To: Song Liu Cc: Song Liu , Networking , bpf , lkml , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kernel Team , "jolsa@kernel.org" , "mhiramat@kernel.org" Subject: Re: [PATCH v2 bpf-next 5/5] bpf: trampoline: support FTRACE_OPS_FL_SHARE_IPMODIFY Message-ID: <20220706174049.6c60250f@gandalf.local.home> In-Reply-To: References: <20220602193706.2607681-1-song@kernel.org> <20220602193706.2607681-6-song@kernel.org> <20220706153843.37584b5b@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Wed, 6 Jul 2022 21:37:52 +0000 Song Liu wrote: > > Can you comment here that returning -EAGAIN will not cause this to repeat. > > That it will change things where the next try will not return -EGAIN? > > Hmm.. this is not the guarantee here. This conflict is a real race condition > that an IPMODIFY function (i.e. livepatch) is being registered at the same time > when something else, for example bpftrace, is updating the BPF trampoline. > > This EAGAIN will propagate to the user of the IPMODIFY function (i.e. livepatch), > and we need to retry there. In the case of livepatch, the retry is initiated > from user space. We need to be careful here then. If there's a userspace application that runs at real-time and does a: do { errno = 0; regsiter_bpf(); } while (errno != -EAGAIN); it could in theory preempt the owner of the lock and never make any progress. -- Steve