lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1400526771.14238.15.camel@joe-AO725>
Date:	Mon, 19 May 2014 12:12:51 -0700
From:	Joe Perches <joe@...ches.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Randy Dunlap <rdunlap@...radead.org>, x86@...nel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	Jason Wessel <jason.wessel@...driver.com>,
	kgdb-bugreport@...ts.sourceforge.net, Hedi Berriche <hedi@....com>,
	Mike Travis <travis@....com>,
	Dimitri Sivanich <sivanich@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Kees Cook <keescook@...omium.org>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] printk: Use symbolic defines for console loglevels

On Mon, 2014-05-19 at 20:27 +0200, Borislav Petkov wrote:
> ... instead of naked numbers.

Seems sensible.

> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -30,6 +30,17 @@ static inline const char *printk_skip_level(const char *buffer)
>  	return buffer;
>  }
>  
> +/* printk's without a loglevel use this.. */
> +#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL

Does anyone actually set CONFIG_DEFAULT_MESSAGE_LOGLEVEL
to something other than 4?

> +/* We show everything that is MORE important than this.. */

It might be nice to show somewhere that larger values are
less important.

> +#define CONSOLE_LOGLEVEL_SILENT  0 /* Mum's the word */
> +#define CONSOLE_LOGLEVEL_MIN	 1 /* Minimum loglevel we let people use */
> +#define CONSOLE_LOGLEVEL_QUIET	 4 /* Shhh ..., when booted with "quiet" */
> +#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
> +#define CONSOLE_LOGLEVEL_DEBUG	10 /* issue debug messages */
> +#define CONSOLE_LOGLEVEL_MOTORMOUTH 15	/* You can't shut this one up */

It may be nicer to have #defines for the
KERN_<LEVEL> numbers from kern_levels.h
and use those here.

Maybe add:

#define LOGLEVEL_EMERG		0
#define LOGLEVEL_ALERT		1
#define LOGLEVEL_CRIT		2
#define LOGLEVEL_ERR		3
#define LOGLEVEL_WARNING	4
#define LOGLEVEL_NOTICE		5
#define LOGLEVEL_INFO		6
#define LOGLEVEL_DEBUG		7

That could clean up a few uses of
magic numbers like 7 in dev_printk_emit


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ