mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Acked-by: Alessandro Zummo <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
06c65eb455
commit
9d013d3b14
1 changed files with 2 additions and 1 deletions
|
|
@ -233,7 +233,8 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
|
|||
break;
|
||||
|
||||
case RTC_PIE_ON:
|
||||
if (!capable(CAP_SYS_RESOURCE))
|
||||
if (rtc->irq_freq > rtc->max_user_freq &&
|
||||
!capable(CAP_SYS_RESOURCE))
|
||||
return -EACCES;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue