Re: [PATCH bpf-next v7 15/24] HID: bpf: allocate data memory for device_event BPF programs
From: Greg KH
Date: Thu Jul 28 2022 - 11:10:20 EST
On Thu, Jul 21, 2022 at 05:36:16PM +0200, Benjamin Tissoires wrote:
> We need to also be able to change the size of the report.
> Reducing it is easy, because we already have the incoming buffer that is
> big enough, but extending it is harder.
>
> Pre-allocate a buffer that is big enough to handle all reports of the
> device, and use that as the primary buffer for BPF programs.
> To be able to change the size of the buffer, we change the device_event
> API and request it to return the size of the buffer.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>