lkml.org 
[lkml]   [2014]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] syslog: provide stub check_syslog_permissions
From
On Thu, Nov 13, 2014 at 9:22 PM, Sebastian Schmidt <yath@yath.de> wrote:
> When building without CONFIG_PRINTK, we need to provide a stub
> check_syslog_permissions. As there is no way to turn on the
> dmesg_restrict sysctl without CONFIG_PRINTK, return success.
>
> Reported-by: Jim Davis <jim.epost@gmail.com>
> Signed-off-by: Sebastian Schmidt <yath@yath.de>

I think this is correct. Without CONFIG_PRINTK, dmesg_restrict doesn't
exist. It's a bit mind-bending, but since all the logic for
capabilities, etc, is also missing, I guess "allow" (return 0) is the
right default without printk.

Thanks!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
> include/linux/syslog.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/syslog.h b/include/linux/syslog.h
> index 9def529..13c05d1 100644
> --- a/include/linux/syslog.h
> +++ b/include/linux/syslog.h
> @@ -48,6 +48,14 @@
> #define SYSLOG_FROM_PROC 1
>
> int do_syslog(int type, char __user *buf, int count, bool from_file);
> +
> +#ifdef CONFIG_PRINTK
> int check_syslog_permissions(int type, bool from_file);
> +#else
> +static int check_syslog_permissions(int type, bool from_file)
> +{
> + return 0;
> +}
> +#endif
>
> #endif /* _LINUX_SYSLOG_H */
> --
> 2.1.1



--
Kees Cook
Chrome OS Security


\
 
 \ /
  Last update: 2014-11-14 21:41    [W:0.057 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site