mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 19:43:43 -04:00
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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
f66556c133
commit
6a9d552483
@@ -814,7 +814,7 @@ void __exit lirc_dev_exit(void)
|
||||
unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX);
|
||||
}
|
||||
|
||||
struct rc_dev *rc_dev_get_from_fd(int fd)
|
||||
struct rc_dev *rc_dev_get_from_fd(int fd, bool write)
|
||||
{
|
||||
struct fd f = fdget(fd);
|
||||
struct lirc_fh *fh;
|
||||
@@ -828,6 +828,9 @@ struct rc_dev *rc_dev_get_from_fd(int fd)
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
if (write && !(f.file->f_mode & FMODE_WRITE))
|
||||
return ERR_PTR(-EPERM);
|
||||
|
||||
fh = f.file->private_data;
|
||||
dev = fh->rc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user