summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/bpf-lirc.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2023-04-13 10:50:32 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2024-02-01 13:48:57 +0100
commit6a9d552483d50953320b9d3b57abdee8d436f23f (patch)
treefae8ab584d5b37806ceccaef3b6205dd53fcfb9b /drivers/media/rc/bpf-lirc.c
parentmedia: atomisp: Adjust for v4l2_subdev_state handling changes in 6.8 (diff)
downloadlinux-6a9d552483d50953320b9d3b57abdee8d436f23f.tar.xz
linux-6a9d552483d50953320b9d3b57abdee8d436f23f.zip
media: rc: bpf attach/detach requires write permission
Note that bpf attach/detach also requires CAP_NET_ADMIN. Cc: stable@vger.kernel.org Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/rc/bpf-lirc.c')
-rw-r--r--drivers/media/rc/bpf-lirc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/rc/bpf-lirc.c b/drivers/media/rc/bpf-lirc.c
index fe17c7f98e81..52d82cbe7685 100644
--- a/drivers/media/rc/bpf-lirc.c
+++ b/drivers/media/rc/bpf-lirc.c
@@ -253,7 +253,7 @@ int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog)
if (attr->attach_flags)
return -EINVAL;
- rcdev = rc_dev_get_from_fd(attr->target_fd);
+ rcdev = rc_dev_get_from_fd(attr->target_fd, true);
if (IS_ERR(rcdev))
return PTR_ERR(rcdev);
@@ -278,7 +278,7 @@ int lirc_prog_detach(const union bpf_attr *attr)
if (IS_ERR(prog))
return PTR_ERR(prog);
- rcdev = rc_dev_get_from_fd(attr->target_fd);
+ rcdev = rc_dev_get_from_fd(attr->target_fd, true);
if (IS_ERR(rcdev)) {
bpf_prog_put(prog);
return PTR_ERR(rcdev);
@@ -303,7 +303,7 @@ int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr)
if (attr->query.query_flags)
return -EINVAL;
- rcdev = rc_dev_get_from_fd(attr->query.target_fd);
+ rcdev = rc_dev_get_from_fd(attr->query.target_fd, false);
if (IS_ERR(rcdev))
return PTR_ERR(rcdev);