Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2048329imu; Sat, 12 Jan 2019 14:05:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5xK93U47fEbe2OfsMV2CVfD8JBAH5+lMigNLKAvpY0K9F7ZRof6yh1vFAao6wk711+GkQI X-Received: by 2002:a62:c28e:: with SMTP id w14mr19770468pfk.115.1547330704754; Sat, 12 Jan 2019 14:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547330704; cv=none; d=google.com; s=arc-20160816; b=HOHTrPFybr+KMejJ1IpKwZeRgfL/FH3tngRze9TlWumWXydm6s6utf8wI5j7wDjKvR BrQMtZ6Ecptw6msnwBhzgMZWIYM3wJwEXMXC5BOOOy3coakiIYfL6C+vm0on0R6Ht35z kTBOlzNQHKrb25E9naaz+hEejYVNudGcyUsLsWysUEq7prhRdoV7684fOi657cwcuRei ERwfeiWwri9cw81A28qELRnwPYyLSfS4NzUDm/iGss8n7y47zyphg25q9Xs8BT8Ut/g8 f1wlc51gvCFosrC6HZyA83DIlimTlQgafiqcd3/SgaWpZ8fixsUkceeTkEvF8v7R34m0 qt+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=IIuWuBnpby15qzYk6DAfxFgsMwgnG/3nS9KOqgcuHpw=; b=Z9LQdfxpcIbgjo18zirny5fQGugXEXOa7sIFXCzgTjEv97MYpVR6kv3Z8fAeSt4hoR 3sLTXwo+XhK9MBqEKrtQVqV0qFjfrz2SX5eEipUFCzAdEILie4HoUFby4eZJnpQsSijn HavI/GNUKBjhcFwZxw9rbCPhyhyCrql24cnhPrgb6LptHzlAr0xmcnRFZYP4FNt5042f paMMlUFpAT+IA7W0ces+yrMNDdRDiLjB7KuzZKWPLf/SuB6RdNESg4k/iAiHHGAfd7q9 Iaq6nPoU4SHXVb4dCcxy1KIYtqd/7bwPjUyJ/hEpquVqpEawopk58wOP3Ue3B1ia42CO Pgeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hartkopp.net header.s=strato-dkim-0002 header.b=thK7fyi4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si56025626pll.10.2019.01.12.14.04.46; Sat, 12 Jan 2019 14:05:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@hartkopp.net header.s=strato-dkim-0002 header.b=thK7fyi4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbfALVbx (ORCPT + 99 others); Sat, 12 Jan 2019 16:31:53 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.50]:16537 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfALVbx (ORCPT ); Sat, 12 Jan 2019 16:31:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1547328711; s=strato-dkim-0002; d=hartkopp.net; h=In-Reply-To:Date:Message-ID:From:References:Cc:To:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=IIuWuBnpby15qzYk6DAfxFgsMwgnG/3nS9KOqgcuHpw=; b=thK7fyi4BvlPrmgs3hFxrXdBsvirfL2r117kD7/t0mh50pALheZsq0buGjXD0xoKFD nF96YoV+A5TLCgirFoGN5GvikO5qUam5q4q16qVGTZRMd0QEKvKxwYKyqZ8tAOq9omv7 cEx1ka6+GcbL2d7leN04f1x4AuqxXcPlQ3wAkW9kmGMIWeSU0sPdEBT7jnE1xlCmzt0f ar4hryygbH5FWbsQNWyt8UXVj43iLPWMwC+YbaQhZJ2yRBMPrOmsirFXDNtNWweaDpsO hPd9d9r1mXlvsoqq6nEOuVQr9Fz6RgohVPJvsGo/vs5Xkxxbznmth4YGA3QK90r2OeJp ZkbQ== X-RZG-AUTH: ":P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrDxb8mjG14FZxedJy6qgO1onTMal6I4rhexKszvVI=" X-RZG-CLASS-ID: mo00 Received: from [192.168.1.200] by smtp.strato.de (RZmta 44.9 DYNA|AUTH) with ESMTPSA id j01e49v0CLPkX0j (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 12 Jan 2019 22:25:46 +0100 (CET) Subject: Re: UBSAN: Undefined behaviour in net/can/bcm.c To: Kyungtae Kim Cc: davem@davemloft.net, Arnd Bergmann , mkl@pengutronix.de, Byoungyoung Lee , DaeRyong Jeong , syzkaller@googlegroups.com, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Oliver Hartkopp Message-ID: <7436eb01-c022-aadc-0d53-b23515ea42aa@hartkopp.net> Date: Sat, 12 Jan 2019 22:25:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/12/19 10:03 PM, Kyungtae Kim wrote: > On Sat, Jan 12, 2019 at 3:02 PM Oliver Hartkopp wrote: >> >> So there could potentially be some other users of timeval_to_ktime() >> that might have the same issue. >> > > The following would be the one related. Yes - it is also in bcm_rx_setup(). Same issue can potentially occur in bcm_tx_setup(). Will send a patch for testing in a minute. Many thanks, Oliver > > ========================================= > UBSAN: Undefined behaviour in ./include/linux/ktime.h:42:14 > signed integer overflow: > -3428892174463270912 * 1000000000 cannot be represented in type 'long int' > CPU: 0 PID: 7024 Comm: syz-executor6 Not tainted 4.19.13 #1 > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 > Call Trace: > __dump_stack lib/dump_stack.c:77 [inline] > dump_stack+0xd2/0x148 lib/dump_stack.c:113 > ubsan_epilogue+0x12/0x94 lib/ubsan.c:159 > handle_overflow+0x1cf/0x21a lib/ubsan.c:190 > __ubsan_handle_mul_overflow+0x2a/0x35 lib/ubsan.c:214 > bcm_timeval_to_ktime include/linux/ktime.h:42 [inline] > bcm_rx_setup net/can/bcm.c:1189 [inline] > bcm_sendmsg+0x35ea/0x3fd0 net/can/bcm.c:1355 > sock_sendmsg_nosec net/socket.c:621 [inline] > sock_sendmsg+0xdd/0x130 net/socket.c:631 > sock_write_iter+0x24b/0x3d0 net/socket.c:900 > call_write_iter include/linux/fs.h:1811 [inline] > new_sync_write fs/read_write.c:474 [inline] > __vfs_write+0x538/0x6e0 fs/read_write.c:487 > vfs_write+0x1b3/0x520 fs/read_write.c:549 > ksys_write+0xde/0x1c0 fs/read_write.c:598 > __do_sys_write fs/read_write.c:610 [inline] > __se_sys_write fs/read_write.c:607 [inline] > __x64_sys_write+0x7e/0xc0 fs/read_write.c:607 > do_syscall_64+0xc4/0x510 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x4497b9 > Code: e8 8c 9f 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 > 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d > 01 f0 ff ff 0f 83 9b 6b fc ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007f6045f43c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 > RAX: ffffffffffffffda RBX: 00007f6045f446cc RCX: 00000000004497b9 > RDX: 0000000000000048 RSI: 00000000200000c0 RDI: 0000000000000013 > RBP: 000000000071bea0 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff > R13: 000000000000ba60 R14: 00000000006f4b00 R15: 00007f6045f44700 > ========================================= > > Thanks, > Kyungtae Kim >