Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463097
| From | Kees Cook <keescook@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | BUG and WARN kernel log levels |
| Date | 2016-08-15 21:00 +0200 |
| Message-ID | <s6vh8-LT-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hi,
So, I noticed that asm-gemeric/bug.h defines BUG() without a log level:
#ifndef HAVE_ARCH_BUG
#define BUG() do { \
printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
Seems like it should have one?
Also, I think we might want to examine WARN() a bit... it doesn't have
a log level either, but only a fraction of callers set one:
$ git grep -E 'WARN(_TAINT|)(_RATELIMIT|_ONCE|)\([^\)]' | grep -v KERN_ | wc -l
2735
$ git grep -E 'WARN(_TAINT|)(_RATELIMIT|_ONCE|)\([^\)]' | grep KERN_ | wc -l
77
If I'm reading checkpatch.pl correctly, it doesn't warn about missing
log levels on WARN calls, but I think it should.
How do you think is best to clean this up?
Mainly, I'd like to add a format string to BUG, or introduce a new
BUGish call that takes a format...
-Kees
--
Kees Cook
Nexus Security
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
BUG and WARN kernel log levels Kees Cook <keescook@google.com> - 2016-08-15 21:00 +0200
Re: BUG and WARN kernel log levels Joe Perches <joe@perches.com> - 2016-08-15 21:10 +0200
Re: BUG and WARN kernel log levels Kees Cook <keescook@google.com> - 2016-08-15 22:30 +0200
Re: BUG and WARN kernel log levels Joe Perches <joe@perches.com> - 2016-08-15 22:40 +0200
Re: BUG and WARN kernel log levels Joe Perches <joe@perches.com> - 2016-08-17 18:40 +0200
Re: BUG and WARN kernel log levels Kees Cook <keescook@google.com> - 2016-08-17 23:30 +0200
Re: BUG and WARN kernel log levels Joe Perches <joe@perches.com> - 2016-08-18 00:50 +0200
csiph-web