diff options
author | Benjamin Tissoires <[email protected]> | 2024-01-24 12:26:57 +0100 |
---|---|---|
committer | Benjamin Tissoires <[email protected]> | 2024-01-31 10:27:00 +0100 |
commit | 7cdd2108903a4e369eb37579830afc12a6877ec2 (patch) | |
tree | 53d7b58e90273e85e237500a2b887a18497d6c5d /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf | |
parent | 00aab7dcb2267f2aef59447602f34501efe1a07f (diff) |
HID: bpf: remove double fdget()
When the kfunc hid_bpf_attach_prog() is called, we called twice fdget():
one for fetching the type of the bpf program, and one for actually
attaching the program to the device.
The problem is that between those two calls, we have no guarantees that
the prog_fd is still the same file descriptor for the given program.
Solve this by calling bpf_prog_get() earlier, and use this to fetch the
program type.
Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/bpf/CAO-hwJJ8vh8JD3-P43L-_CLNmPx0hWj44aom0O838vfP4=_1CA@mail.gmail.com/T/#t
Cc: <[email protected]>
Fixes: f5c27da4e3c8 ("HID: initial BPF implementation")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Benjamin Tissoires <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf')
0 files changed, 0 insertions, 0 deletions