Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4821634ybf; Wed, 4 Mar 2020 11:20:35 -0800 (PST) X-Google-Smtp-Source: ADFU+vs/DiKmCbUNE5aSGqoyQlrH1y09lcqV3YxYnaErDoc4mkjGMPfy2mg1FIXhSPcXaUx+TdyO X-Received: by 2002:aca:8d5:: with SMTP id 204mr2752991oii.141.1583349635271; Wed, 04 Mar 2020 11:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583349635; cv=none; d=google.com; s=arc-20160816; b=jRG5AMe6XTbDzr25LxRZMTLoCau3OcimcGbpVynlpY7FgtI1wHfBcc8GDKN8LAXzXd fObEIO5WKzOaK6t/dmhMeRjEnfayUO4XeEtI35KaZHAx0UZxFUiVxEgfrRaCu+Ofzqy+ qfv/sXrGiD3oQYpqBWwdfiZOux27i0m5eQiDkMAl962v/dsbNVY/zkNX/NNmju/b4nmk lRIDh5HTpQmMxBJ5MBeC7tdtEqBIHbx+qIjPMnK85Tw9MGuwy0DJUcXNVFALxpL4be8N UA/mZ7zODcSEdHLaCtzpEmyvXrVtY03pXAilJq9SAloBZri4MX5yVPVUEe6P85xrEqE1 N8qg== 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=LLC9sgmmsNJqhA3e8n44JfktHvetMKZClvCd6fP6yLPNSRFjQC49ezyfeIRHq56YV3 U8Nb7ITiiFGdsGyQra9zQGkfdrYpQ7MX4X+2HmqGJlAnDUpLB/Pp4HTq6Ux/Wo1IxcWJ IePMdL45DxUn+pHUZYaiRjkmSwUVUhPSXx2qm24HhfZsWvyQar21BUodnvIliotc7vQv ssCMOx8SQDHPiMwrL5eCv1lf2V9iw46KPM+6MfKNmH63SDPd5Q6d3aa3HfDQJOyQLOxP H8crWIW3UbEWzCzUpSUVLOhPnsIlWdukzbHzJ/GImza+xalFy0qUR3MH3Au/ovtX8t+b hvdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FE5efpYR; 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 l21si1741330oic.126.2020.03.04.11.20.23; Wed, 04 Mar 2020 11:20:35 -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=FE5efpYR; 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 S1728779AbgCDTTG (ORCPT + 99 others); Wed, 4 Mar 2020 14:19:06 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37653 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727137AbgCDTTF (ORCPT ); Wed, 4 Mar 2020 14:19:05 -0500 Received: by mail-wr1-f67.google.com with SMTP id q8so3873956wrm.4 for ; Wed, 04 Mar 2020 11:19:04 -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=FE5efpYRwoF7VVTPXIG28AriU/JlAE3lJtKyUjEtXvjYIKn4CTF1F8sA/xwVRw7/Ja ZGoPiWq0rU9dhtjilYW3yxsFLNJ2FSZsUN9mawMbbAqDAYSfXLgdKXYW7JOlDqLHKyiF nEpGRY+LiTH44lDXfBDzT0XKESedJkyr3VfSQ= 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=QxAoyYf4tCzBNnytqg4hheUN2x/qA8F4VJe5ZW0FiO+McR4WdOEt4ZkXd1DzSS+6HG W73b6rIULkAaZefW/o6qOsGFheeQaTn/TaL4TMbQcOZZCPFXS6De0WHuEMp+dLaBv5OP SCwKEyx8IHfx9iIFJ/k8jwzU/+ynrAG3cHvPCj7SZeN2rTcaI5ewjoYxufGcxAMpWsP7 ailNOsq9aP4OtIm973Dxx/gypqZWXyCrnvqLXJcWsuJQEFirHqw42Ji5qtWur+1G4LSW sHlViWNt9E0JdEbnDIMf4SVpchCmnY2o71xrB64QSmVO+bJ+nxe6gkv9lbTdKQ6BnLZD PcZg== X-Gm-Message-State: ANhLgQ0ZVvRQ7XxoDQcZQrZ2gq+EFjwJdtwzjgNGzwD+OTvncfU/jgyP z24lKK89ppBWdwcRd4Dfn+tpjg== X-Received: by 2002:a5d:4ecb:: with SMTP id s11mr5541348wrv.83.1583349543923; Wed, 04 Mar 2020 11:19:03 -0800 (PST) Received: from kpsingh-kernel.localdomain (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id w9sm2018556wrn.35.2020.03.04.11.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 11:19:03 -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 v4 5/7] tools/libbpf: Add support for BPF_MODIFY_RETURN Date: Wed, 4 Mar 2020 20:18:51 +0100 Message-Id: <20200304191853.1529-6-kpsingh@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200304191853.1529-1-kpsingh@chromium.org> References: <20200304191853.1529-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