Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3090686pxm; Mon, 28 Feb 2022 11:49:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl8q6v1Rv7yx4uSL/2GiCLFaJ+XrWavIl6G1kpMd3pXHmockkAildP8c5rS4nMmaX0gAP1 X-Received: by 2002:a17:902:d504:b0:14d:846f:e7da with SMTP id b4-20020a170902d50400b0014d846fe7damr16488887plg.133.1646077752511; Mon, 28 Feb 2022 11:49:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646077752; cv=none; d=google.com; s=arc-20160816; b=ovhjo2ie/s1fJCWoWNIWcWdkMIH8n7lq/TCmGtMOcsyfFqn+5Nck0telQ2Yd7MPOu+ U/nkRgohMhsuyPKs2YGXWCHtsySZ2eWzfI6onM2R3gcyN9P8iZGisIT7RVOo9xDQjc0G 36f5bZ/XowK1YZuGuAcnJiBNz9o4bjQIvZ5I0auXDiiwMLAo5T/D99MEXN9Qc2mAl89X iJs3chf4qPk0NmApHRvEzCTwE86grETUrvVWcUSPD2cnHq4xXaDC/di2B1Gm3LdECLpf HydqMVBsSZGaG1VrMSOXYm01nTabDlQ1LfZ/4Pql8oFy5RzITcb0QaXsKkEam/D/pupW 2fBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TBNyyVKFIgtXo2siONgO+K8rh6ETB7+JIbrxg9YBDkY=; b=iR/TCCwSbp+IxiO6ikghDLasPGYIJRhMClS9x8Vvv5Muf16iBACocj1yRGdXC7s+1k k7D8LHdOJkvwMSOT4tustBSA9jAiohZaiO+pl0LNQQLGuoxG2kKhHTy6VgMc9ZDD7Fib R+hU+6Ml9rcBNfLvzOd/oD/W2OARziiYnPwLzK/aptmMh8AwLf0+TX70PdT9Fud7cw+r OVs4NkOPqBToxhBwQVdVdDx4ownIWRf2RG2xc6XIb+8BViMkETNg6Zem6ail95VjONmu ZesJl83o0pyibdBw0v4+vlWMwZvRRafoz3JRiRPeP771quMdnM+22vUYL9aMfiQKsMzt gKHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RDZg6FLd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id gz24-20020a17090b0ed800b001bc66e2e66csi297410pjb.154.2022.02.28.11.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:49:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RDZg6FLd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 870BD109A79; Mon, 28 Feb 2022 11:25:21 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238150AbiB1RhC (ORCPT + 99 others); Mon, 28 Feb 2022 12:37:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238873AbiB1Rd6 (ORCPT ); Mon, 28 Feb 2022 12:33:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4878B9399A for ; Mon, 28 Feb 2022 09:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646069433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TBNyyVKFIgtXo2siONgO+K8rh6ETB7+JIbrxg9YBDkY=; b=RDZg6FLdaLIpDOd+CDVdMEsTHyKOp276FRMvtUA75t+rQCb6a1tA74+LfJz8ygjmhVsGM6 Mh2lier5aB6ddsnIqSpirj5WPiF7a5dbJK9UjBuxHDdu7R7wjSjYj5AaN7NE3ZJZA8RF/Y gQwHgSxgmjLTOVBbKAGjkVoZKUa1dxk= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-567-gBEVDOdGOOeCOY5olWqBiQ-1; Mon, 28 Feb 2022 12:30:32 -0500 X-MC-Unique: gBEVDOdGOOeCOY5olWqBiQ-1 Received: by mail-pl1-f198.google.com with SMTP id x6-20020a1709029a4600b0014efe26b04fso5084324plv.21 for ; Mon, 28 Feb 2022 09:30:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TBNyyVKFIgtXo2siONgO+K8rh6ETB7+JIbrxg9YBDkY=; b=4JetjpUMRjBdsXQcFvYsv+eclTCfGg31G1RQIjTs7v3O6vHNresqgUHi7xb0O7Pv6Q rl0b5jNIrhoyzUGX/lS9WVg4mQ68fkgqm/GyPE6xaAMnn+GozciSEoa+7WxO/TM8b16R AT8CkNeOWTyhtV4RxbUkGtEPnbrLhni//LbUQHMB+8MOet1YaNuzMeXgp6YXTWVjAq4W SKuEBV92Ir79Ofjt1fzfZoALhnNlNd30mc+4KVwcapAqllkx/B7//6If+G2tubC+59tc TMdBr2vOuXg12tNXfskl58RhqcXm+qA2Z5sHFPO+OcLbxzeaPsDFbbpJSFNiZ275vcf6 sDMA== X-Gm-Message-State: AOAM530e1HzofgNrdinWLTSM/K4GkDyyZdJ7s/zne/4b4sdjyJGs8dpc nGbIJCTGBdpqVQMWM/eXfA5Rb2Iskc1VhehFE4wAcKPjjz5FFovzZAiRffeh8aouBvxylbP2jWR boAMkDqqXN4ftVKKsfgPgYKT3FbMnWXKWRxxlDMah X-Received: by 2002:a17:90a:560a:b0:1bc:72e7:3c13 with SMTP id r10-20020a17090a560a00b001bc72e73c13mr17481032pjf.246.1646069430727; Mon, 28 Feb 2022 09:30:30 -0800 (PST) X-Received: by 2002:a17:90a:560a:b0:1bc:72e7:3c13 with SMTP id r10-20020a17090a560a00b001bc72e73c13mr17481014pjf.246.1646069430520; Mon, 28 Feb 2022 09:30:30 -0800 (PST) MIME-Version: 1.0 References: <20220224110828.2168231-1-benjamin.tissoires@redhat.com> <20220224110828.2168231-2-benjamin.tissoires@redhat.com> In-Reply-To: From: Benjamin Tissoires Date: Mon, 28 Feb 2022 18:30:19 +0100 Message-ID: Subject: Re: [PATCH bpf-next v1 1/6] HID: initial BPF implementation To: Greg KH Cc: Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Tero Kristo , lkml , "open list:HID CORE LAYER" , Networking , bpf , linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Thu, Feb 24, 2022 at 12:41 PM Greg KH wrote: > > On Thu, Feb 24, 2022 at 12:08:23PM +0100, Benjamin Tissoires wrote: > > index 000000000000..243ac45a253f > > --- /dev/null > > +++ b/include/uapi/linux/bpf_hid.h > > @@ -0,0 +1,39 @@ > > +/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */ > > + > > +/* > > + * HID BPF public headers > > + * > > + * Copyright (c) 2021 Benjamin Tissoires > > + */ > > + > > +#ifndef _UAPI__LINUX_BPF_HID_H__ > > +#define _UAPI__LINUX_BPF_HID_H__ > > + > > +#include > > + > > +#define HID_BPF_MAX_BUFFER_SIZE 16384 /* 16kb */ > > + > > +struct hid_device; > > + > > +enum hid_bpf_event { > > + HID_BPF_UNDEF = 0, > > + HID_BPF_DEVICE_EVENT, > > +}; > > + > > +/* type is HID_BPF_DEVICE_EVENT */ > > +struct hid_bpf_ctx_device_event { > > + __u8 data[HID_BPF_MAX_BUFFER_SIZE]; > > + unsigned long size; > > That's not a valid type to cross the user/kernel boundry, shouldn't it > be "__u64"? But really, isn't __u32 enough here? Fixed locally with a __u16 instead. Will be present in v2. Cheers, Benjamin