Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1616413 > unrolled thread
| Started by | Kees Cook <keescook@chromium.org> |
|---|---|
| First post | 2017-04-05 00:20 +0200 |
| Last post | 2017-04-05 21:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION Kees Cook <keescook@chromium.org> - 2017-04-05 00:20 +0200
Re: [kernel-hardening] [PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION Ian Campbell <ijc@hellion.org.uk> - 2017-04-05 07:50 +0200
Re: [kernel-hardening] [PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION Kees Cook <keescook@chromium.org> - 2017-04-05 21:40 +0200
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-04-05 00:20 +0200 |
| Subject | [PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION |
| Message-ID | <tsEXT-2s7-17@gated-at.bofh.it> |
This expands on the Kconfig help text for CONFIG_BUG_ON_DATA_CORRUPTION to
more clearly explain the rationale of BUG vs WARN. Additionally fixes a
grammar glitch in the macro comment.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
include/linux/bug.h | 3 ++-
lib/Kconfig.debug | 9 ++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 687b557fc5eb..db1e41c69bac 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -124,7 +124,8 @@ static inline enum bug_trap_type report_bug(unsigned long bug_addr,
/*
* Since detected data corruption should stop operation on the affected
- * structures. Return value must be checked and sanely acted on by caller.
+ * structures, require that the condition is checked and sanely acted on
+ * by the caller.
*/
static inline __must_check bool check_data_corruption(bool v) { return v; }
#define CHECK_DATA_CORRUPTION(condition, fmt, ...) \
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 77fadface4f9..5ac4d1148385 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1998,9 +1998,12 @@ config BUG_ON_DATA_CORRUPTION
bool "Trigger a BUG when data corruption is detected"
select DEBUG_LIST
help
- Select this option if the kernel should BUG when it encounters
- data corruption in kernel memory structures when they get checked
- for validity.
+ This option enables several inexpensive data corruption checks.
+ Most of these checks normally just WARN and try to further avoid
+ the corruption. Selecting this option upgrades these to BUGs so
+ that the offending process is killed. Additionally, the system
+ owner can furhter configure the system for immediate reboots
+ (via panic_on_oops sysctl) or crash dumps.
If unsure, say N.
--
2.7.4
[toc] | [next] | [standalone]
| From | Ian Campbell <ijc@hellion.org.uk> |
|---|---|
| Date | 2017-04-05 07:50 +0200 |
| Subject | Re: [kernel-hardening] [PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION |
| Message-ID | <tsLZo-6V8-9@gated-at.bofh.it> |
| In reply to | #1616413 |
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 77fadface4f9..5ac4d1148385 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1998,9 +1998,12 @@ config BUG_ON_DATA_CORRUPTION
> > bool "Trigger a BUG when data corruption is detected"
> > select DEBUG_LIST
> > help
> > - Select this option if the kernel should BUG when it encounters
> > - data corruption in kernel memory structures when they get checked
> > - for validity.
> > + This option enables several inexpensive data corruption checks.
> > + Most of these checks normally just WARN and try to further avoid
> + the corruption. Selecting this option upgrades these to BUGs so
First it says it enables some checks, but here it says it upgrades them
to BUGs which seems inconsistent.
> + that the offending process is killed. Additionally, the system
> + owner can furhter configure the system for immediate reboots
"further"
> + (via panic_on_oops sysctl) or crash dumps.
>
> > If unsure, say N.
>
[toc] | [prev] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-04-05 21:40 +0200 |
| Subject | Re: [kernel-hardening] [PATCH v2 1/7] bug: Clarify help text for BUG_ON_DATA_CORRUPTION |
| Message-ID | <tsYWB-6NO-19@gated-at.bofh.it> |
| In reply to | #1616581 |
On Tue, Apr 4, 2017 at 10:47 PM, Ian Campbell <ijc@hellion.org.uk> wrote: >> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug >> index 77fadface4f9..5ac4d1148385 100644 >> --- a/lib/Kconfig.debug >> +++ b/lib/Kconfig.debug >> @@ -1998,9 +1998,12 @@ config BUG_ON_DATA_CORRUPTION >> > bool "Trigger a BUG when data corruption is detected" >> > select DEBUG_LIST >> > help >> > - Select this option if the kernel should BUG when it encounters >> > - data corruption in kernel memory structures when they get checked >> > - for validity. >> > + This option enables several inexpensive data corruption checks. >> > + Most of these checks normally just WARN and try to further avoid >> + the corruption. Selecting this option upgrades these to BUGs so > > First it says it enables some checks, but here it says it upgrades them > to BUGs which seems inconsistent. Right, it does both. It uses Kconfig "select" to enable checks, and raises checks from WARN to BUG. > >> + that the offending process is killed. Additionally, the system >> + owner can furhter configure the system for immediate reboots > > "further" Ah, thanks! > >> + (via panic_on_oops sysctl) or crash dumps. >> >> > If unsure, say N. >> -Kees -- Kees Cook Pixel Security
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web