]> 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 b652cc14dd60904b9299cbf17a57ebc69288ce77..fc552d524ef773d9f8f4b3c868d91f6e84fddf54 100644 (file)
@@ -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);