linux/drivers/media
Sean Young 04177aa99a media, bpf: Do not copy more entries than user space requested
[ Upstream commit 647d446d66 ]

The syscall bpf(BPF_PROG_QUERY, &attr) should use the prog_cnt field to
see how many entries user space provided and return ENOSPC if there are
more programs than that. Before this patch, this is not checked and
ENOSPC is never returned.

Note that one lirc device is limited to 64 bpf programs, and user space
I'm aware of -- ir-keytable -- always gives enough space for 64 entries
already. However, we should not copy program ids than are requested.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210623213754.632-1-sean@mess.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-19 09:44:53 +02:00
..
cec media: s5p_cec: decrement usage count if disabled 2021-07-14 16:56:02 +02:00
common media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2() 2021-07-14 16:56:05 +02:00
dvb-core media: dvb_net: avoid speculation from net slot 2021-07-14 16:55:54 +02:00
dvb-frontends media: dvb: Add check on sp8870_readreg return 2021-06-03 09:00:42 +02:00
firewire media: firewire: fix memory leak 2020-09-27 11:29:45 +02:00
i2c media: tc358743: Fix error return code in tc358743_probe_of() 2021-07-14 16:56:05 +02:00
mc media: Fix Media Controller API config checks 2021-07-14 16:55:56 +02:00
mmc media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
pci media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev 2021-07-14 16:56:11 +02:00
platform media: exynos4-is: remove a now unused integer 2021-07-14 16:56:54 +02:00
radio Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
rc media, bpf: Do not copy more entries than user space requested 2021-07-19 09:44:53 +02:00
spi media: i2c/Kconfig: use sub-menus for I2C support 2020-04-16 10:34:40 +02:00
test-drivers media: vivid: fix assignment of dev->fbuf_out_flags 2021-05-14 09:50:22 +02:00
tuners media: m88rs6000t: avoid potential out-of-bounds reads on arrays 2021-05-14 09:50:23 +02:00
usb media: gspca/gl860: fix zero-length control requests 2021-07-14 16:56:05 +02:00
v4l2-core media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev 2021-07-14 16:56:11 +02:00
Kconfig media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00
Makefile media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00