[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 for-4.10] ubsan: add clang 5.0 support



>>> On 18.10.17 at 09:45, <roger.pau@xxxxxxxxxx> wrote:
> +void __ubsan_handle_pointer_overflow(struct pointer_overflow_data *data,
> +                             unsigned long base, unsigned long result)
> +{
> +     unsigned long flags;
> +
> +     if (suppress_report(&data->location))
> +             return;
> +
> +     ubsan_prologue(&data->location, &flags);
> +
> +     if (((long)base >= 0) == ((long)result >= 0))
> +             pr_err("pointer operation %s %p to %p\n",
> +                     base > result ? "underflowed" : "overflowed",
> +                     (void *)base, (void *)result);
> +     else
> +             pr_err("pointer index expression with base %p overflowed to 
> %p\n",
> +                     (void *)base, (void *)result);

Would you mind explaining the difference between if and else
branches? (I do realize I should have asked this on v1 already,
but I didn't pay enough attention.) Whatever the idea behind
this, it should probably be explained in a comment, as it looks
to be heuristic.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.