Skip to content

Commit 9d013d3

Browse files
Bryan KadzbanLinus Torvalds
authored andcommitted
rtc: allow validated RTC_PIE_ON for non-root
drivers/char/rtc.c allowed RTC_PIE_ON ioctls for non-root users, as long as the current interval (set via RTC_IRQP_SET) is <= max_user_freq. Allow RTC_PIE_ON under the same conditions when /dev/rtc* is handled by the rtc subsystem. Signed-off-by: Bryan Kadzban <bryan@kdzbn.homelinux.net> Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 06c65eb commit 9d013d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/rtc/rtc-dev.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
233233
break;
234234

235235
case RTC_PIE_ON:
236-
if (!capable(CAP_SYS_RESOURCE))
236+
if (rtc->irq_freq > rtc->max_user_freq &&
237+
!capable(CAP_SYS_RESOURCE))
237238
return -EACCES;
238239
break;
239240
}

0 commit comments

Comments
 (0)