Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1252025 > unrolled thread
| Started by | Rasmus Villemoes <linux@rasmusvillemoes.dk> |
|---|---|
| First post | 2015-10-20 22:40 +0200 |
| Last post | 2015-10-26 07:40 +0100 |
| Articles | 2 — 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 07/13] lib/test_printf.c: don't BUG Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-10-20 22:40 +0200
Re: [PATCH 07/13] lib/test_printf.c: don't BUG Kees Cook <keescook@chromium.org> - 2015-10-26 07:40 +0100
| From | Rasmus Villemoes <linux@rasmusvillemoes.dk> |
|---|---|
| Date | 2015-10-20 22:40 +0200 |
| Subject | [PATCH 07/13] lib/test_printf.c: don't BUG |
| Message-ID | <qlLRp-6h1-49@gated-at.bofh.it> |
BUG is a completely unnecessarily big hammer, and we're more likely to
get the internal bug reported if we just pr_err() and ensure the test
suite fails.
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
lib/test_printf.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/test_printf.c b/lib/test_printf.c
index c5a666af9ba5..9232a2add28c 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -91,7 +91,12 @@ __test(const char *expect, int elen, const char *fmt, ...)
int rand;
char *p;
- BUG_ON(elen >= BUF_SIZE);
+ if (elen >= BUF_SIZE) {
+ pr_err("error in test suite: expected output length %d too long. Format was '%s'.\n",
+ elen, fmt);
+ failed_tests++;
+ return;
+ }
va_start(ap, fmt);
--
2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2015-10-26 07:40 +0100 |
| Message-ID | <qnJBM-4Q3-7@gated-at.bofh.it> |
| In reply to | #1252025 |
On Wed, Oct 21, 2015 at 5:30 AM, Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
> BUG is a completely unnecessarily big hammer, and we're more likely to
> get the internal bug reported if we just pr_err() and ensure the test
> suite fails.
>
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> lib/test_printf.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/lib/test_printf.c b/lib/test_printf.c
> index c5a666af9ba5..9232a2add28c 100644
> --- a/lib/test_printf.c
> +++ b/lib/test_printf.c
> @@ -91,7 +91,12 @@ __test(const char *expect, int elen, const char *fmt, ...)
> int rand;
> char *p;
>
> - BUG_ON(elen >= BUF_SIZE);
> + if (elen >= BUF_SIZE) {
> + pr_err("error in test suite: expected output length %d too long. Format was '%s'.\n",
> + elen, fmt);
> + failed_tests++;
> + return;
> + }
>
> va_start(ap, fmt);
>
> --
> 2.6.1
>
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web