From d5f028c00f096f00133f1c3134919d2a31e4e95d Mon Sep 17 00:00:00 2001 From: Kenneth Aafloy Date: Fri, 16 Jul 2004 19:24:59 +0000 Subject: - Do not allow write (and related) ioctls when frontend is opened RDONLY. --- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 7748ba9b6..c68c57116 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -709,6 +709,11 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file, if (!fe || !fe->frontend.ioctl || fe->exit) return -ENODEV; + if ((file->f_flags & O_ACCMODE) == O_RDONLY && + (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT || + cmd == FE_DISEQC_RECV_SLAVE_REPLY)) + return -EPERM; + if (down_interruptible (&fe->sem)) return -ERESTARTSYS; -- cgit v1.2.3