New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601727 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
ex-Googler
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Integer-overflow in sqlite3MulInt64

Project Member Reported by ClusterFuzz, Apr 8 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5358119705640960

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97uS-CxuOUPmqcQxO7YmFz-hk6OJmMt8WICfy1Ttn-okXReDpC99XxSJ0CG1tpV6u_XzYlM58VCw277IJj-Hyz1HgLCl9AMMpk21Shwi12JUFC55006ZskXZBHFE4fV1L0E9GqrE72-qlovV_wyBRtfDosXdA
(SELECT-3452005775[a]WHERE a+a*A


Filer: mmoroz

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Cc: mmoroz@chromium.org kcc@chromium.org aizatsky@chromium.org
Labels: -Stability-Crash
Owner: js...@chromium.org
Labels: Stability-Crash
Project Member

Comment 3 by ClusterFuzz, May 25 2016

ClusterFuzz has detected this testcase as flaky and is unable to reproduce it in the original crash revision. Skipping fixed testing check and marking it as potentially fixed.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5358119705640960

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97uS-CxuOUPmqcQxO7YmFz-hk6OJmMt8WICfy1Ttn-okXReDpC99XxSJ0CG1tpV6u_XzYlM58VCw277IJj-Hyz1HgLCl9AMMpk21Shwi12JUFC55006ZskXZBHFE4fV1L0E9GqrE72-qlovV_wyBRtfDosXdA
(SELECT-3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 4 by ClusterFuzz, May 27 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5420459801968640

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv95v806v8JFIh9-5Bb_uh7-uyM-r7D24q59UmszqiC1JY8jN3feqnLGZu8p_LSCvPLI605qaqQzqfFpwSqgKUJyIMatev13cshdiePM0Xxdq32rYfySx_32N75xycaA8ZNl-b8GeTJCbg7LaETGBEepg3G-Z9A
(SELECT 3452005775[a]WHERE a+a*A


Filer: mmoroz

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Project Member

Comment 5 by ClusterFuzz, Jun 27 2016

ClusterFuzz has detected this testcase as flaky and is unable to reproduce it in the original crash revision. Skipping fixed testing check and marking it as potentially fixed.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5420459801968640

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97AqGU2RhTcDLwi25neWIGo0Z6sWPhUY_fKjsUsQiDaGHbuELWupFZzRsKM4u-9nOrLhFRgHAZNsd3inckHIvtXOajCyQ3OUpYVrEBWuQbDEWCbFutlwUna_MByM-xRlMWKVBEo6QNLisgESF6JmrQduXmUfA?testcase_id=5420459801968640
(SELECT 3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 6 by ClusterFuzz, Jun 29 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=4666706840780800

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97BwZlMTHLuvMDumTMcA-ZomqleFYrNSsFp1Al2SmGIHy9wKSe_I9kd_cygviBW1gHheyzZvJ6gP7yd1_RqLDi9Y7CUK6hUpSGWTa-8IduKMW4qyWIFkxQAZfPfz6VUOSnk24aKn1n5PdyNLWlcYpnfldSRwg?testcase_id=4666706840780800
(SELECT 3452005775[a]WHERE a+a*A


Filer: mmoroz

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Project Member

Comment 7 by ClusterFuzz, Jul 29 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6599490379448320

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97ptaj1TUxpzuzkYzSGj5t7wMK3YMWvAQm1BHLBhclmcJbA_r7XeqzWTfKLUtbvzTrpkwvd1E3O4iNxE9Wz2HYW_envbL2ooEe2vQOLY4ZfU9XL_RHBiTwi151u9-fF3QxJR-xY-hUXbGWEGf4nDnOAewdgqA?testcase_id=6599490379448320
(SELECT 3452005775[a]WHERE a+a*A


Filer: rnimmagadda

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Also, suspecting:

Author: delcypher
Project: chromium-libfuzzer
Changelist: https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer.git/+/c84c7383e7b76dd6e3258ca5e5df4584b57d2297
Time: Thu May 19 22:00:33 2016
Lines 441-447 of file FuzzerLoop.cpp which potentially caused crash are changed in this cl (frame #6, "fuzzer::Fuzzer::RunOne").
Minimum distance from crash line to modified line: 0. (file: FuzzerLoop.cpp, crashed on: 441, modified: 441).


Gentle Ping.

@jshin: Could you please provide some update on this issue.

Thank you.
Project Member

Comment 10 by ClusterFuzz, Aug 25 2016

ClusterFuzz has detected this issue as fixed in range 413961:414068.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6599490379448320

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=413961:414068

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97ptaj1TUxpzuzkYzSGj5t7wMK3YMWvAQm1BHLBhclmcJbA_r7XeqzWTfKLUtbvzTrpkwvd1E3O4iNxE9Wz2HYW_envbL2ooEe2vQOLY4ZfU9XL_RHBiTwi151u9-fF3QxJR-xY-hUXbGWEGf4nDnOAewdgqA?testcase_id=6599490379448320
(SELECT 3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 11 by ClusterFuzz, Aug 25 2016

ClusterFuzz has detected this issue as fixed in range 413961:414068.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=4666706840780800

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=395640:395746
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=413961:414068

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97BwZlMTHLuvMDumTMcA-ZomqleFYrNSsFp1Al2SmGIHy9wKSe_I9kd_cygviBW1gHheyzZvJ6gP7yd1_RqLDi9Y7CUK6hUpSGWTa-8IduKMW4qyWIFkxQAZfPfz6VUOSnk24aKn1n5PdyNLWlcYpnfldSRwg?testcase_id=4666706840780800
(SELECT 3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 12 by ClusterFuzz, Aug 25 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5434888906080256

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414214:414310

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97XAOBqwH5-najSjw5hSC2tahU20KPboqRVe5OkUhxauQe7Am7a4bbJn-Wx7bon40fr3L59fb0hKUMRd9R0JkWPSgwSjLOnzXKoNV7_AADleQa7BcP3Kc3GSuMkxRlbhF-2eVfpokj6VSGkWiHKZI1nVP1VCA?testcase_id=5434888906080256
(SELECT 3452005775[a]WHERE a+a*A


Issue manually filed by: mmohammad

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Project Member

Comment 13 by ClusterFuzz, Aug 26 2016

ClusterFuzz has detected this issue as fixed in range 414399:414444.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5434888906080256

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414214:414310
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414399:414444

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv97XAOBqwH5-najSjw5hSC2tahU20KPboqRVe5OkUhxauQe7Am7a4bbJn-Wx7bon40fr3L59fb0hKUMRd9R0JkWPSgwSjLOnzXKoNV7_AADleQa7BcP3Kc3GSuMkxRlbhF-2eVfpokj6VSGkWiHKZI1nVP1VCA?testcase_id=5434888906080256
(SELECT 3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 14 by ClusterFuzz, Aug 26 2016

Labels: ClusterFuzz-Verified
Status: Verified (was: Available)
ClusterFuzz testcase is verified as fixed, closing issue.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Labels: ClusterFuzz-Wrong
Status: Assigned (was: Verified)
Re-Opening the issue as Clusterfuzz has detected the crash again, Clusterfuzz update in the next comment.Thank you 
Project Member

Comment 16 by ClusterFuzz, Aug 26 2016

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5237939238076416

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414663:414681

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv95Oh-GjR0pa4r55eU3wa4gJS57x9jriQsEe1YNb58VXJIK9rSZxglTrOHotFATz7EYvjHfC2oZHP-IIDqKptCw5UM69xvlLFf0YygeYLajsEpizAnCWwT_6d18mclbZmI1xHupJMqRe4c4lo8-mDL0npRdg-Q?testcase_id=5237939238076416
(SELECT-3452005775[a]WHERE a+a*A


Issue manually filed by: mmohammad

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.
Project Member

Comment 17 by ClusterFuzz, Aug 27 2016

ClusterFuzz has detected this issue as fixed in range 414779:414830.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=5237939238076416

Fuzzer: libfuzzer_sqlite3_prepare_v2_fuzzer
Job Type: libfuzzer_chrome_ubsan
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  sqlite3MulInt64
  sqlite3VdbeExec
  sqlite3Step
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414663:414681
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_ubsan&range=414779:414830

Minimized Testcase (0.03 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv95Oh-GjR0pa4r55eU3wa4gJS57x9jriQsEe1YNb58VXJIK9rSZxglTrOHotFATz7EYvjHfC2oZHP-IIDqKptCw5UM69xvlLFf0YygeYLajsEpizAnCWwT_6d18mclbZmI1xHupJMqRe4c4lo8-mDL0npRdg-Q?testcase_id=5237939238076416
(SELECT-3452005775[a]WHERE a+a*A


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Cc: sh...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Sorry that I haven't responed sooner. It's related to ICU in sqlite. 

Comment 19 by sh...@chromium.org, Sep 20 2016

Owner: sh...@chromium.org
Status: Started (was: Available)
jshin: You sure?  Looks like |SELECT 3452005775*3452005775| is an integer overflow.

I need to parse out what's happening, though.  The value is less than 2^32, but sqlite3 command-line gives -<many digits>, so it's possible that it's a conversion error.  Checking with a new version of sqlite, just in case.

Comment 20 by sh...@chromium.org, Sep 20 2016

Yeah, sqlite3MulInt64() tries to detect overflow by whether the inputs are set in bit 32 or higher, but overflow can also happen for 31-bit values (notably sqrt(2^63)+1 is within 32 bits).  I have an email out to sqlite core, while I let my brain work out the right bits to check.

Comment 21 by sh...@chromium.org, Sep 20 2016

https://www.sqlite.org/src/info/1ec41379c9c1e400

I don't think there's right bits to check.  The code in question is approximately right for unsigned integers, but signed integers aren't going to work that way.  I'm kinda wondering if it's a case where it's easiest to assume 2s-complement, and do the work in the unsigned realm.

That said ... given the usage of the code in question, it's not obvious where the undefined-ness of signed integer overflow can lead anywhere interesting.  Due to the inputs coming via the virtual machine, it's pretty unlikely to be noticed as actionable by the compiler, even with inlining, even with really extensive inlining.  But YMMV.

Comment 23 by sh...@chromium.org, Sep 28 2016

Status: Fixed (was: Started)
Fixed AFAICT.  Now SELECT 3452005775*3452005775 returns 1.1916343870633351e+19.
Project Member

Comment 24 by sheriffbot@chromium.org, Nov 22 2016

Labels: -Restrict-View-EditIssue
Removing EditIssue view restrictions from ClusterFuzz filed bugs. If you believe that this issue should still be restricted, please reapply the label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -ClusterFuzz-Wrong
We have made a bunch of changes on ClusterFuzz side, so resetting ClusterFuzz-Wrong label.

Sign in to add a comment