Messages in this thread | | | Date | Sun, 24 May 2015 19:09:35 +0300 | From | Vasily Averin <> | Subject | Re: [PATCH] kernel/printk/printk.c: check_syslog_permissions() cleanup |
| |
On 15.05.2015 01:01, Andrew Morton wrote: > On Sun, 10 May 2015 09:35:53 +0300 Vasily Averin <vvs@odin.com> wrote: >> --- a/kernel/printk/printk.c >> +++ b/kernel/printk/printk.c >> @@ -484,11 +484,11 @@ int check_syslog_permissions(int type, bool from_file) >> * already done the capabilities checks at open time. >> */ >> if (from_file && type != SYSLOG_ACTION_OPEN) >> - return 0; >> + goto ok; > > This seems wrong - we should only call security_syslog() for opens?
No I think my version is correct. Currently security hook _is_ called in this situation: from_file is set in /proc/kmsg handlers only, they use do_syslog() and call security_syslog() directly after check_syslog_permissions() call.
My patch forces check_syslog_permissions() to call security hook in all cases, that allows to remove extra security_syslog() call from do_syslog().
I've changed patch comment and going to resend new patch version soon.
| |