Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727153

Re: UBSAN: Undefined error in time.h signed integer overflow

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From John Stultz <john.stultz@linaro.org>
Newsgroups linux.kernel
Subject Re: UBSAN: Undefined error in time.h signed integer overflow
Date Wed, 06 Sep 2017 07:00:02 +0200
Message-ID <umABs-4JW-9@gated-at.bofh.it> (permalink)
References <umABs-4JW-11@gated-at.bofh.it>
X-Original-To Shankara Pailoor <sp3485@columbia.edu>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=K3Jsp/iVyidZGyhwjqr+55oFDYFXbRJfUgiTMmv24eU=; b=UYCEzP2jmgRghwM8JmGCz6rayviaxqLYnq32P5qBDIg8rRzfSpihB8eKh3ImaDI5ok 9jjkZbFcb1ecIywCaDq2qCUgXLxln7LcgE51MttfKjgtE6u/oTwjAXJ36Sm8q6dvJOla 4mDelGrI3wy7TA04lPs3WmtpeeR0w7hxR8lXw=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=K3Jsp/iVyidZGyhwjqr+55oFDYFXbRJfUgiTMmv24eU=; b=AKILtrMTRXllj8m23s/2amp15PLKCaab86CzyW3bEdxNC9zY5GsLVKSKEdDg2pcaiy F5YGb9r7iIbP3TBIi1Jc6qLGiyefiNYBl8TlGYE30CwA21e+hX3DCd5Xis6SspLHQ/79 ttTWsnpV1ZII4dG047DO+9DeAqU71GITLMI8TX8zTZtpx0Z0PMcGwvSNDEPsJU3nR5eh I/o39u+apvmIoKso7+1D+pkV09FuPy7DmzlmvAWFZ9gTaaUCbPMeyuzqcknjWyqjClBt lg0ySOlUCiRkAtbt7T5+vuSCXCvygXNdWqqVlW/BAlNDqzwaHqMqsT5O1NcT+Kjls2ow vNgw==
X-Gm-Message-State AHPjjUgQ00b11m0z1OqWpmbXzCrulAPiqFykIQmJlB57xafvR5n92kCf 5VP+/GStAOYNufrPFiCy27exK34u5rBLsaEJxg==
X-Google-SMTP-Source ADKCNb7NeI5MqyWdDBgySFd8R3jlecpyDkuzKa4FNTuW17kRYdANrwkD96qKdte3GBODLbIVo0yV0guMjVcVNiX/5Zc=
X-Received by 10.28.0.7 with SMTP id 7mr619069wma.109.1504673726491; Tue, 05 Sep 2017 21:55:26 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
X-Original-Cc lkml <linux-kernel@vger.kernel.org>, syzkaller <syzkaller@googlegroups.com>, Thomas Gleixner <tglx@linutronix.de>, Stephen Boyd <sboyd@codeaurora.org>
X-Original-Date Tue, 5 Sep 2017 21:55:25 -0700
X-Original-Message-ID <CALAqxLWr9vakTzi3wgfwKbRjsZKdPqbO6w47Dka_us2EAGQBYw@mail.gmail.com>
X-Original-References <CAASgV=vRCcjLxPfPq3T47wUU41arPDrZb=O1N7bktZh3ebcJpg@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1727153

Show key headers only | View raw


On Tue, Sep 5, 2017 at 9:30 PM, Shankara Pailoor <sp3485@columbia.edu> wrote:
> Hi,
>
> I encountered this bug while fuzzing linux kernel 4.13-rc7 with syzkaller.
>
> ================================================================================
> UBSAN: Undefined behaviour in ./include/linux/time.h:233:27
> signed integer overflow:
> 8391720337152500783 * 1000000000 cannot be represented in type 'long int'
> CPU: 0 PID: 31798 Comm: syz-executor2 Not tainted 4.13.0-rc7 #2
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> Ubuntu-1.8.2-1ubuntu1 04/01/2014
> Call Trace:
>  __dump_stack lib/dump_stack.c:16 [inline]
>  dump_stack+0xf7/0x1ae lib/dump_stack.c:52
>  ubsan_epilogue+0x12/0x8f lib/ubsan.c:164
>  handle_overflow+0x21e/0x292 lib/ubsan.c:195
>  __ubsan_handle_mul_overflow+0x2a/0x3e lib/ubsan.c:219
>  timespec_to_ns include/linux/time.h:233 [inline]
>  posix_cpu_timer_set+0xb5c/0xf20 kernel/time/posix-cpu-timers.c:686
>  do_timer_settime+0x1f4/0x390 kernel/time/posix-timers.c:890
>  SYSC_timer_settime kernel/time/posix-timers.c:916 [inline]
>  SyS_timer_settime+0xea/0x170 kernel/time/posix-timers.c:902
>  entry_SYSCALL_64_fastpath+0x18/0xad
> RIP: 0033:0x451e59
> RSP: 002b:00007fb62af4fc08 EFLAGS: 00000216 ORIG_RAX: 00000000000000df
> RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 0000000000451e59
> RDX: 0000000020006000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000046 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000020003fe0 R11: 0000000000000216 R12: 00000000004be920
> R13: 00000000ffffffff R14: ffffffffffffffff R15: 0000000000000000
> ================================================================================

Looks similar to the issue Thomas fixed here:
   https://patchwork.kernel.org/patch/9799827/


Thomas: Should we change timespec_to_ns() to use the same transition
internally rather then trying to track all the callers?

thanks
-john

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: UBSAN: Undefined error in time.h signed integer overflow John Stultz <john.stultz@linaro.org> - 2017-09-06 07:00 +0200
  Re: UBSAN: Undefined error in time.h signed integer overflow Thomas Gleixner <tglx@linutronix.de> - 2017-09-06 10:10 +0200

csiph-web