From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966614AbcAZQCo (ORCPT ); Tue, 26 Jan 2016 11:02:44 -0500 Received: from mx2.parallels.com ([199.115.105.18]:39455 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964834AbcAZQCj (ORCPT ); Tue, 26 Jan 2016 11:02:39 -0500 Subject: Re: UBSAN: Undefined behaviour in drivers/usb/core/devio.c:1517:25 To: Alan Stern , Chris Bainbridge References: CC: , , , From: Andrey Ryabinin Message-ID: <56A798DB.8000200@virtuozzo.com> Date: Tue, 26 Jan 2016 19:03:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: US-EXCH.sw.swsoft.com (10.255.249.47) To US-EXCH.sw.swsoft.com (10.255.249.47) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2016 06:25 PM, Alan Stern wrote: > On Tue, 26 Jan 2016, Chris Bainbridge wrote: > >> Booting 4.5.0-rc1 with new UBSAN checker enabled: >> >> [ 4.556968] ================================================================================ >> [ 4.556972] UBSAN: Undefined behaviour in drivers/usb/core/devio.c:1517:25 >> [ 4.556975] shift exponent -1 is negative > > Does a left shift by a negative amount matter if the result isn't used? > By definition, any code with undefined behavior could do anything. But in practice, undefined shift just leads to undefined result of shift operation (it depends on operands and architecture). > Alan Stern >