syslog: Provide stub check_syslog_permissions
authorSebastian Schmidt <yath@yath.de>
Fri, 14 Nov 2014 18:51:45 +0000 (10:51 -0800)
committerTony Luck <tony.luck@intel.com>
Mon, 17 Nov 2014 18:28:04 +0000 (10:28 -0800)
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>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
include/linux/syslog.h

index 9def5297dbb72fb4b96dce54ce581b65363c948b..4b7b875a7ce1febdacb9f54c887210de0f28216f 100644 (file)
 #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 inline int check_syslog_permissions(int type, bool from_file)
+{
+       return 0;
+}
+#endif
 
 #endif /* _LINUX_SYSLOG_H */