Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1285508 > unrolled thread

[PATCH] ubsan-run-time-undefined-behavior-sanity-checker-fix-2

Started byAndrey Ryabinin <aryabinin@virtuozzo.com>
First post2015-12-07 16:10 +0100
Last post2015-12-07 16:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ubsan-run-time-undefined-behavior-sanity-checker-fix-2 Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-07 16:10 +0100

#1285508 — [PATCH] ubsan-run-time-undefined-behavior-sanity-checker-fix-2

FromAndrey Ryabinin <aryabinin@virtuozzo.com>
Date2015-12-07 16:10 +0100
Subject[PATCH] ubsan-run-time-undefined-behavior-sanity-checker-fix-2
Message-ID<qD5Am-6co-7@gated-at.bofh.it>
In GCC internals __ubsan_handle_builtin_unreachable() declared
with "noreturn" attribute. Make it noreturn in-kernel too.
Since we can't return from such function call panic() instead.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 lib/ubsan.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/ubsan.c b/lib/ubsan.c
index 84e000f..479f582 100644
--- a/lib/ubsan.c
+++ b/lib/ubsan.c
@@ -422,16 +422,16 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
 }
 EXPORT_SYMBOL(__ubsan_handle_shift_out_of_bounds);
 
-void __ubsan_handle_builtin_unreachable(struct unreachable_data *data)
+
+void __noreturn
+__ubsan_handle_builtin_unreachable(struct unreachable_data *data)
 {
 	unsigned long flags;
 
-	if (suppress_report(&data->location))
-		return;
-
 	ubsan_prologue(&data->location, &flags);
 	pr_err("calling __builtin_unreachable()\n");
 	ubsan_epilogue(&flags);
+	panic("can't return from __builtin_unreachable()");
 }
 EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable);
 
-- 
2.4.10

--
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] | [standalone]


Back to top | Article view | linux.kernel


csiph-web