[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <565C9A8E.4060604@oracle.com>
Date: Mon, 30 Nov 2015 13:50:54 -0500
From: Sasha Levin <sasha.levin@...cle.com>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Jonathan Corbet <corbet@....net>,
Michal Marek <mmarek@...e.cz>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Yury Gribov <y.gribov@...sung.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Konstantin Khlebnikov <koct9i@...il.com>,
Kostya Serebryany <kcc@...gle.com>, x86@...nel.org,
linux-doc@...r.kernel.org, linux-kbuild@...r.kernel.org
Subject: Re: [PATCH v3 2/2] UBSAN: run-time undefined behavior sanity checker
On 11/30/2015 10:59 AM, Andrey Ryabinin wrote:
> +void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
> + unsigned long lhs, unsigned long rhs)
> +{
> + unsigned long flags;
> + struct type_descriptor *rhs_type = data->rhs_type;
> + struct type_descriptor *lhs_type = data->lhs_type;
> + char rhs_str[VALUE_LENGTH];
> + char lhs_str[VALUE_LENGTH];
> +
> + if (suppress_report(&data->location))
> + return;
> +
> + ubsan_prologue(&data->location, &flags);
> +
> + val_to_string(rhs_str, sizeof(rhs_str), rhs_type, rhs);
> + val_to_string(lhs_str, sizeof(lhs_str), lhs_type, lhs);
> +
> + if (val_is_negative(rhs_type, rhs))
> + pr_err("shift exponent %s is negative\n", rhs_str);
> +
> + else if (get_unsigned_val(rhs_type, rhs) >=
> + type_bit_width(lhs_type))
> + pr_err("shift exponent %s is to large for %u-bit type %s\n",
too
Otherwise looks great, I'm running fuzzing with it now.
Thanks,
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists