From patchwork Thu Dec 7 01:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kui-Feng Lee X-Patchwork-Id: 13482557 X-Patchwork-Delegate: bpf@iogearbox.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UbFIc3HJ" Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464C0D65 for ; Wed, 6 Dec 2023 17:40:20 -0800 (PST) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5d8e816f77eso1766537b3.0 for ; Wed, 06 Dec 2023 17:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701913219; x=1702518019; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4sjjYs0SoUIMGBIggG2RmbInOgfFHHKp5K529V1i6nE=; b=UbFIc3HJIKv0kmG7nwuVayAeBemd3bCuPXnVrXt9igNyzAyIXGJbAjAFut3x0Eta7x 3yMAeCnjAo70TtCDvj0O/25epwEEh1nm7mvkqiZnTOcXbwANDFEG5u9xOC9VYuPCOYOI 4KO2fHGOUGbRgoddjotkQDLpqNhXJ3eDTqjeiunfLWdUe5b6R5L6rV5MsYawwJVeys/H vndwuEX4Gqaw3uOcivxD7s3EBG9lqovRKwCBhsZHVge8Z3TAYRqhrEUj1tInolwXH54H f+eIIa1kZEbgsEmfMLAY8FObFDbrCdJewD5HwLjzfpEmieNleCaPHzucMoWjxF6KOgoJ Jb6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701913219; x=1702518019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4sjjYs0SoUIMGBIggG2RmbInOgfFHHKp5K529V1i6nE=; b=MHgxM2t1zcoRLI52tw3bAwCfyHWuB7lCneP1kedW2W8JOMiNbc/1aXjw8nTFLDjq5N Q6LUSCvw/WGKoxwaQdQQKC3qbFLkHaYYm9TvPSv43FTeQSf0kto41I3r2xlZdzJS23h8 SL19NffhXmPdFZEZKPXZ8Owcia7VMI9cAzuRxrOYlhzfFKi0YB/nv6xtWq6sBsKdrZTL wMkq/zwrwHUh5yOK8sQbP+gqh9Lcq3D82Psz8R4Vnsx7zE/S0STVCiBfgOvRMah9Rd5n KKvQ0EGa2jv2WI+eSX/JEZxnSOQbvMJBmukEsR4KelX7zG83kToPe7eXrdhSr8x+x80t H+aw== X-Gm-Message-State: AOJu0YwMLeiYlb7sv4HyMf27jajt6tarzyx5mmSbKddn45J1BDoWZaEn +iMDn1XVtZ1bDMqu8cCRPMyNEjZSbKk= X-Google-Smtp-Source: AGHT+IEw4AplwopDBeMMomwhkPSkd3WQTwP/9mJMPJ6E65N4JOQsKlSNNPDpqiGt+SbeFllOxBcc6g== X-Received: by 2002:a05:690c:fc9:b0:5d4:fc0:79f3 with SMTP id dg9-20020a05690c0fc900b005d40fc079f3mr2028058ywb.23.1701913219286; Wed, 06 Dec 2023 17:40:19 -0800 (PST) Received: from kickker.attlocal.net ([2600:1700:6cf8:1240:c8f2:3a3b:3003:f559]) by smtp.gmail.com with ESMTPSA id v134-20020a81488c000000b005d997db3b2fsm60768ywa.23.2023.12.06.17.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 17:40:18 -0800 (PST) From: thinker.li@gmail.com To: bpf@vger.kernel.org, ast@kernel.org, martin.lau@linux.dev, song@kernel.org, kernel-team@meta.com, andrii@kernel.org, drosen@google.com Cc: sinquersw@gmail.com, kuifeng@meta.com, Kui-Feng Lee Subject: [PATCH bpf-next v12 12/14] bpf: export btf_ctx_access to modules. Date: Wed, 6 Dec 2023 17:39:48 -0800 Message-Id: <20231207013950.1689269-13-thinker.li@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231207013950.1689269-1-thinker.li@gmail.com> References: <20231207013950.1689269-1-thinker.li@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Kui-Feng Lee The module requires the use of btf_ctx_access() to invoke bpf_tracing_btf_ctx_access() from a module. This function is valuable for implementing validation functions that ensure proper access to ctx. Signed-off-by: Kui-Feng Lee --- kernel/bpf/btf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 5545dee3ff54..d9cdf41e8f34 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6142,6 +6142,7 @@ bool btf_ctx_access(int off, int size, enum bpf_access_type type, __btf_name_by_offset(btf, t->name_off)); return true; } +EXPORT_SYMBOL_GPL(btf_ctx_access); enum bpf_struct_walk_result { /* < 0 error */