Re: [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler

From: Andrey Ryabinin
Date: Tue Oct 10 2017 - 08:20:17 EST


On 10/10/2017 10:06 AM, Prasad Sodagudi wrote:
> In LLVM __ubsan_handle_type_mismatch handler is renamed to
> __ubsan_handle_type_mismatch_v1. Add support for
> __ubsan_handle_type_mismatch_v1 handler to avoid compilation
> issues with latest llvm tool chain. Also keeping
> __ubsan_handle_type_mismatch handler for backward compatibility.
>
> Signed-off-by: Prasad Sodagudi <psodagud@xxxxxxxxxxxxxx>
> ---

NACK. It wasn't *just* the rename, that wouldn't make any sense.
It was renamed because of the change in the ABI, which is not reflected in your patch,
so it can't work.


> lib/ubsan.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/lib/ubsan.c b/lib/ubsan.c
> index fb0409d..9baf17d 100644
> --- a/lib/ubsan.c
> +++ b/lib/ubsan.c
> @@ -328,6 +328,14 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
> }
> EXPORT_SYMBOL(__ubsan_handle_type_mismatch);
>
> +void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data *data,
> + unsigned long ptr)
> +{
> + __ubsan_handle_type_mismatch(data, ptr);
> +}
> +EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);
> +
> +
> void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
> {
> unsigned long flags;
>