Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1532190lqt; Sat, 8 Jun 2024 02:06:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgIo0QYZe0vjLtXgnH8yM7ZHmC6Ua9sWrDqHpl9N/bLAXT0MqX3fA9LX7h82r32ZC0chIYUzU1WFs+Nsq7NnBLIpvi8QmrkJKE6Q6Y1w== X-Google-Smtp-Source: AGHT+IGgocnV75mXETWD3HENOG5+v4DuQEc2nrIVsKkoSFt5cWNqJ6xqvXdBLAUVj86/GEAGCsO3 X-Received: by 2002:a05:620a:4103:b0:795:5a73:25bb with SMTP id af79cd13be357-7955a732822mr20522485a.17.1717837596965; Sat, 08 Jun 2024 02:06:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717837596; cv=pass; d=google.com; s=arc-20160816; b=DvRWZC8tqfTk994jaxim0ZepAXcxcgGCJcN6B3vc9XgiSd3PmSnOfOiiPsQ0ZePyQz vJXMbJSLTUuX1CsMcdpG1j1xRE5jvy8fSqU1lQ1SfI3RBX7Ix1X6tsw9xKhGEVfmO1xM E/EOfEFq++eIjiq3SGPi4vkuIQ+0eAHYdNnZQ3Wx+6SY4507A8QLHnFbS6yO2csm235o HesK+7gKalGneAVNNZI6XWm/0vhPixeY7GjhtOo7hVA3L5/6Unm1H67fSDf9HDhbQo1f MuTdkEE7Rh55mab8IDQPzXKyM7XbWxgvxkTix5PZWEOesZgRMTVvu7RD4/CLmzpoHXjA H2xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NHqBxcUPwiGHkkff5n+hcjAceM4wHbKXuL+NNuIE6VQ=; fh=YpHnV/6uyiPbG6kMterX8knOBa279otQWiSdSsr99Bc=; b=bWlto+lS7DZh/6ZjUwYj4jnnzV9aCJGwCtBle0s7106tJRecZaizrpZrKl1+BOBJI6 bljl2ytgabop/KCXJ/Js1AXtCG2WePPNTosFigdvdd7dpgGgEJtCvJ0g9jfIHbYcWZgR QpvdboRIZyla5KIGCSYVe2t7Sh0asXxvelieSaz9BvlKJlPoCUHWOC233KDOEy/EHMax yfbN+lPl6EzO27IyJlLY5cYq3QF2WAJAxXNvRECDkGgOkUI0OelszH1ZWXZKtIKHyuCd 2CapNZXHrqMCrKXGxXs8IkyojGa8UYQF+mCr39+OTrmkQzMN6hbkQQaQ5185v+9/eHOa 0d6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmGw4jqy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206978-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206978-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4405303bc87si19994231cf.342.2024.06.08.02.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 02:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206978-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmGw4jqy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206978-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206978-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A911A1C21761 for ; Sat, 8 Jun 2024 09:06:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9143E17C9E7; Sat, 8 Jun 2024 09:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hmGw4jqy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB13F17D353; Sat, 8 Jun 2024 09:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717837314; cv=none; b=Jo2DGSNi1cxdmM7+IRLtSrFzG9hocHX8orIV2DyEyGzO4UYJSFPUgluHO5LV7FQH1OyuLl+Q1PKAAp14vuI5JBltQvzX5Zf2I8KpzFJ2XkNoXfRQKdvfE47Ism1xeJ4IC8miGqCXg7qkhY4lpHjp1G3EyQwjX9a890bh434OFfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717837314; c=relaxed/simple; bh=764BpJJ+0RLPa1xYfm3CFomwnOdKd7B+O2p4oCLJSr4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PNjrK7rPlL+LXSj35k3496AdKgKvw0xXm1oHalgeGScGL13EkphGFXFX9DfdPvNrCuwQM7PttkhMIooSUq+d8LdX+G5Xaq/paUGfjlY4GPsbq4nqQn5H5IPvzZqN9rRbj2UQwitJXR1Yw1ECKiSWKrsjhzqtd5M+kVzmT49ONvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hmGw4jqy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 889A2C2BD11; Sat, 8 Jun 2024 09:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717837314; bh=764BpJJ+0RLPa1xYfm3CFomwnOdKd7B+O2p4oCLJSr4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hmGw4jqyeZX9gecOAZcpA9hmMobqBFmqa8gADRChp1F6lyxiomcPQgildieiDIeHi 79C4RbLHmTT6Jt2pfFwn2lo4hi8tzqYrnTswAd2sdpksuEurkiwRMev9axRvgUf9+W Q+uxgTSag9NQP1LmwMCnwhkOtdGY24J0xRu4Lou5OiwwfDmHML2lVRskAGYNNbeQ70 AmgjKvebEiwn89xyCAwF8Sp425/z0u4dNo1I/N07aOnhbpLpmiQlJtvTEk7VpOwN5G 5F7XXT+fUNsa/GuEveL0L6axBaDojTBhQImTCeZTczCtGNfneYLzMWc4SBG10PPo+j AWlJSoElkXMSA== From: Benjamin Tissoires Date: Sat, 08 Jun 2024 11:01:26 +0200 Subject: [PATCH HID v3 14/16] bpf: allow bpf helpers to be used into HID-BPF struct_ops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240608-hid_bpf_struct_ops-v3-14-6ac6ade58329@kernel.org> References: <20240608-hid_bpf_struct_ops-v3-0-6ac6ade58329@kernel.org> In-Reply-To: <20240608-hid_bpf_struct_ops-v3-0-6ac6ade58329@kernel.org> To: Shuah Khan , Jiri Kosina , Jonathan Corbet , Alexei Starovoitov Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, Benjamin Tissoires X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717837279; l=865; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=764BpJJ+0RLPa1xYfm3CFomwnOdKd7B+O2p4oCLJSr4=; b=V0vyUFFgCONMp6lGmOJ7JyItCEU/faMXE1HkrIoGTlhdEetexQxlAgu8tl/Kg7y59HfFCltvk uvu3DakWhr+B6kteKAMVA0Q2w3qVEKoQ22jQJhXz/gsdmyhGPlybtYH X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= Without this helpers like bpf_printk() or bpf_map_update() are not available, making anything but change of bytes impossible to do. Signed-off-by: Benjamin Tissoires --- no changes in v3 new in v2 --- drivers/hid/bpf/hid_bpf_struct_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/bpf/hid_bpf_struct_ops.c b/drivers/hid/bpf/hid_bpf_struct_ops.c index 9192c66cde20..056d05d96962 100644 --- a/drivers/hid/bpf/hid_bpf_struct_ops.c +++ b/drivers/hid/bpf/hid_bpf_struct_ops.c @@ -89,6 +89,7 @@ static int hid_bpf_ops_btf_struct_access(struct bpf_verifier_log *log, } static const struct bpf_verifier_ops hid_bpf_verifier_ops = { + .get_func_proto = bpf_base_func_proto, .is_valid_access = hid_bpf_ops_is_valid_access, .btf_struct_access = hid_bpf_ops_btf_struct_access, }; -- 2.44.0