]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - lib/ubsan.c
Merge tag 'f2fs-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
[linux.git] / lib / ubsan.c
index e7d31735950de7c0980967164ce21ba0ca8b77c0..fc552d524ef773d9f8f4b3c868d91f6e84fddf54 100644 (file)
@@ -119,7 +119,7 @@ static void val_to_string(char *str, size_t size, struct type_descriptor *type,
 {
        if (type_is_int(type)) {
                if (type_bit_width(type) == 128) {
-#if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)
+#if defined(CONFIG_ARCH_SUPPORTS_INT128)
                        u_max val = get_unsigned_val(type, value);
 
                        scnprintf(str, size, "0x%08x%08x%08x%08x",
@@ -374,9 +374,10 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
        struct type_descriptor *lhs_type = data->lhs_type;
        char rhs_str[VALUE_LENGTH];
        char lhs_str[VALUE_LENGTH];
+       unsigned long ua_flags = user_access_save();
 
        if (suppress_report(&data->location))
-               return;
+               goto out;
 
        ubsan_prologue(&data->location, &flags);
 
@@ -402,6 +403,8 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
                        lhs_type->type_name);
 
        ubsan_epilogue(&flags);
+out:
+       user_access_restore(ua_flags);
 }
 EXPORT_SYMBOL(__ubsan_handle_shift_out_of_bounds);