Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4638525ybf; Wed, 4 Mar 2020 07:48:56 -0800 (PST) X-Google-Smtp-Source: ADFU+vuiFKlszapiPbJGFkkWFg/HOJcFzM9WI0N/Mh5JgYAvBVwqa065fvwciJwTzOEy1iRuyjZq X-Received: by 2002:aca:75d7:: with SMTP id q206mr2219219oic.27.1583336936763; Wed, 04 Mar 2020 07:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583336936; cv=none; d=google.com; s=arc-20160816; b=sKS+8kEEqRMMn7qrHg19FmBvo6+EIvToq+jLWbT1c4gOiem7w4HwZxIuEEZYMwgF1H xgU5YsTACkWAYpZ0zyfbfQn11njQUmfihVZqlWVg74CyjzYEMvhHpAwKwPKbYk1KOu/h Cex29KstgquQKQ2Taa3i9S16al5OMII52lJ8YkieGGw4SE/rSrftb8mc46cMwKHOQtqg ikqxB3yorVWr4lM40wg9YfKLjzZp4zzS9Uimm9bcmAYibP2Mk79fIHeJudAqq3qeExT1 k4IdtMNU7w8MeRD9iqOLht8GnWnscPk0fZaM5clsBqw8RReni3hHIvw6Fo9l/nGtaZVq cyiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LRL6J9WKtvx/RPJ0atWk9n/5aR6bK+oJrTzd62kZy8U=; b=hmDAd+qvKGYSMfx08kAvOpoK/d+9jy5cD2isl9bhfNjkT2j1Z+aksQNNFTvIdeRM1c mpPH406q7gTy0cZDh7kv/0qWg7cUtkRs+HvrEzDKTPx7KSccwFNg+9HdLCJNtqTuw+KS 7qaDVWIEFE9k5r4GMx0XZ3QHtoRR0I7uOe9p9wpuO0IXS5EtJCVpYGCZImypfRZynlgG g31TKjljFPD6fuxEnWkb+xa0y0tDFiRILE07guAriVKJsycopgpefe2/+FJLOl08C3mX l9FaIVD67/j9JCSCv2lknBVtU5sQCRrNOu59+kXRFL3bmYbXni58eEIPdlJ7rslo2Quy QtoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ie8ZqTul; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si1501994oto.46.2020.03.04.07.48.45; Wed, 04 Mar 2020 07:48:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ie8ZqTul; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388147AbgCDPsC (ORCPT + 99 others); Wed, 4 Mar 2020 10:48:02 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54208 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388063AbgCDPsB (ORCPT ); Wed, 4 Mar 2020 10:48:01 -0500 Received: by mail-wm1-f66.google.com with SMTP id g134so2642750wme.3 for ; Wed, 04 Mar 2020 07:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LRL6J9WKtvx/RPJ0atWk9n/5aR6bK+oJrTzd62kZy8U=; b=Ie8ZqTulx72jXcIilsU1d/WAVSGRYBCLfmfJux0wONI0NlvrKQ9Enw2cSDDGVsHmSU lVYjEsE+LZfyyPRfmG6NsHrFnMRoLf45pDyr8xuxkLLuVPPWwBFDc/7quKSaQnxJb1tH pPdtLx8zLfLFzNwYXT8e6srppXRhLdtZmK/Fk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LRL6J9WKtvx/RPJ0atWk9n/5aR6bK+oJrTzd62kZy8U=; b=ewbbewxK4iqYf02OT5s8MP+3iA73FUfs3seoyrRfym6KTB89BIlkzqwzqJ1H9Gdpa7 UE2sGsi/3vERYxNpv0MITcvOv6GvI2QTjsXgobYze4xZ11/0l4tU1RUmWk9aIkhDlIZD M3fLb+S59IGx6lt/kFQ9L3WjuzxxTzdkVacUyB8kI59Exnc7U+N2hkleTSomj/UAV6NZ stEveC8lbqvGvA+5sTcrsgpDuRCtr/VYlYuGbcQh9pr8tR6MJgCDZq+Uea+EbECeZC4E YVOCYyj0R6Ub8hNhBg18z6GUmAWc01uUrdCN+pMgVJ+/T4HSow+Gxehe7cAAHMG0QVEx YwHw== X-Gm-Message-State: ANhLgQ0zAH27RSBcsgGbr9MLS2JUMbmSU6hiH9bJE9t5cE716BYhOi/J Zt0eLbdkAHdXI4wJd/eoCBYpdA== X-Received: by 2002:a1c:a5c2:: with SMTP id o185mr4094248wme.173.1583336879927; Wed, 04 Mar 2020 07:47:59 -0800 (PST) Received: from kpsingh-kernel.localdomain ([2a00:79e1:abc:308:8ca0:6f80:af01:b24]) by smtp.gmail.com with ESMTPSA id u25sm4816091wml.17.2020.03.04.07.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 07:47:59 -0800 (PST) From: KP Singh To: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Paul Turner , Jann Horn , Florent Revest , Brendan Jackman Subject: [PATCH bpf-next v3 5/7] tools/libbpf: Add support for BPF_MODIFY_RETURN Date: Wed, 4 Mar 2020 16:47:45 +0100 Message-Id: <20200304154747.23506-6-kpsingh@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200304154747.23506-1-kpsingh@chromium.org> References: <20200304154747.23506-1-kpsingh@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: KP Singh Signed-off-by: KP Singh Acked-by: Andrii Nakryiko --- tools/lib/bpf/libbpf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index f8c4042e5855..223be01dc466 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -6288,6 +6288,10 @@ static const struct bpf_sec_def section_defs[] = { .expected_attach_type = BPF_TRACE_FENTRY, .is_attach_btf = true, .attach_fn = attach_trace), + SEC_DEF("fmod_ret/", TRACING, + .expected_attach_type = BPF_MODIFY_RETURN, + .is_attach_btf = true, + .attach_fn = attach_trace), SEC_DEF("fexit/", TRACING, .expected_attach_type = BPF_TRACE_FEXIT, .is_attach_btf = true, -- 2.20.1