Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1718691pxm; Thu, 24 Feb 2022 08:09:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyE7Q/qL3ek9T9k4zTuAAiSyV9iF54BKjRl8I7+fuYpxiYBC58R9BsNCk/eQ22E2mm0/yYv X-Received: by 2002:a17:902:9b90:b0:14d:4c30:a66b with SMTP id y16-20020a1709029b9000b0014d4c30a66bmr3161164plp.22.1645718978648; Thu, 24 Feb 2022 08:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645718978; cv=none; d=google.com; s=arc-20160816; b=fBwkv6ScREBdhfkSvY5JDgm0FpL5fdM8VkFvNLMDis+lsHn0LdXoOE4Tpnn7Af/Pyz N88cjV7QHB2u0Brv7yQ02hRBHuDaBOiXwM6knCnzdTr1dm+V4PJ+/2GXE4R/0sDnwT4Q 1sdkWSYebKgq7Tg6d0HHYCcXuZUIqdjzpuVBMx1iVx/c+7NFVCuV5jbtqPXv3EIzOsQ0 pErSAg9KCqZDd3Yce2GDRbmGVykF1XkZJ9fkHwDwix6WnkAVxy2iloYLLK7KAITwdBaX prwVtiQRlNxM58nDH5uigb1aYn+FfFSwITpaabCLcAd831ib6AT4o9cjeAF7sCdRbSKG 1UlQ== 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=nW0eks/cUbzpUTn5JZlT+rD6G7IprS9N+XGNcxMKob0=; b=FPOF4ntR9ra5ZMixCIL2h6i/sdp0lgI7OkPaWL9aG5PAT73DewL0JJqN+R1O4Getaa nKEg+I0vYQsNpPsQ/4QNk9i+COaLBvzNfBGi96vNuDtzWg5nWbQtmB6GHFuJyhhI+WWg BHPV7+rSYD2hiRQoJyaINkUCAROCPet54s+102tY2M2nWpQosOIsY9R7AegFPkDJLUi2 9o02BPNWZB4qACa3dEgpiU4doEA4zRX3yFSQY3Z7XJtVoLFHmnBqS/2Db0fcVzkVKB3N BzOIPWmVO8cL3meaujYmFTs6UUNJ1W4qx78mA/Wc3fZI65zTQ5e7X4poPUYP8nIrpEmE XqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SKX//xaK"; 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 z9si2770351ple.448.2022.02.24.08.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:09:38 -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="SKX//xaK"; 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 E9EA91BF90D; Thu, 24 Feb 2022 08:05:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235253AbiBXNxl (ORCPT + 99 others); Thu, 24 Feb 2022 08:53:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235245AbiBXNxh (ORCPT ); Thu, 24 Feb 2022 08:53:37 -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 7374B13C25A for ; Thu, 24 Feb 2022 05:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645710785; 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=nW0eks/cUbzpUTn5JZlT+rD6G7IprS9N+XGNcxMKob0=; b=SKX//xaKnJufs2LW8fbsXCVi4Yo8lc/RUtk81nckOAc9IREhueBfjsAc/0ydExasL9dTWb DINH7Bhax2dhVXNSDbHS7m616kNQ16jaBZlXRYF5srJQoHBda29gwws4dq8a7gFZIgkzsu NILD5KyHtSb4bx81ANVz5LCbPq8Hu0s= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-177-iZ4YmzygOriwpjv7xuIdXw-1; Thu, 24 Feb 2022 08:53:04 -0500 X-MC-Unique: iZ4YmzygOriwpjv7xuIdXw-1 Received: by mail-pj1-f71.google.com with SMTP id t12-20020a17090abc4c00b001bc770db571so1338781pjv.5 for ; Thu, 24 Feb 2022 05:53:04 -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=nW0eks/cUbzpUTn5JZlT+rD6G7IprS9N+XGNcxMKob0=; b=eHwXMkg2ggGnR9/LMwamj9kTW1eWF7vYBJpA0g66lyiyBwXNQh100u5lzpFxM6EAbR 75+G4T7/GFYCyYjz8ldXkahh49x3j+qqw/c4LinroVAbSIkxtvTaNGilnuFcxjeV4wY8 knLwjibZFmbILIs9OTO7N3IbqjzPYCkQK1z0lwVaGjtoPpo8teVDZJLxdydZjjPdpVG6 TSOQM2N519waEdmTw2KfS0gX/VFIlgW+BoO2y64GvovJm5CVOqR8DCmaX+SYePdUVEKr Sm3iJZtWvfUK0kYJv7ecKwcyd5lgJUAMjpYdXrMebpJyClQZs/Cp2eNUb3nIUsVkSczY kLBA== X-Gm-Message-State: AOAM5301FXGQQ2ipV7dI/g0N0AjTvy0h1dUBhGnOmFqb1at324H/1UBF jpswHNq4pAcy0mtgQ0jToHWp0iXjaRo8D+1C96A7oM5S5WGOmECqbTMP+r68qMGCDCbpGN0spWy ViwWHO0SPHRjFqKMZBHOXABp6AhkzKSsbp4AC/zOc X-Received: by 2002:a17:90b:3796:b0:1bc:c077:5be4 with SMTP id mz22-20020a17090b379600b001bcc0775be4mr2926057pjb.113.1645710783274; Thu, 24 Feb 2022 05:53:03 -0800 (PST) X-Received: by 2002:a17:90b:3796:b0:1bc:c077:5be4 with SMTP id mz22-20020a17090b379600b001bcc0775be4mr2926032pjb.113.1645710783083; Thu, 24 Feb 2022 05:53:03 -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: Thu, 24 Feb 2022 14:52:52 +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" , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 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=no 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? thanks. Even __u16 should be enough, given that the upper bound is 16384. I'll amend it in v2. Cheers, Benjamin > > thanks, > > greg k-h >