Avoid invalid dereference in RANGE_HASHED() dictionary#20345
Merged
kitaisreal merged 1 commit intoClickHouse:masterfrom Feb 12, 2021
Merged
Avoid invalid dereference in RANGE_HASHED() dictionary#20345kitaisreal merged 1 commit intoClickHouse:masterfrom
kitaisreal merged 1 commit intoClickHouse:masterfrom
Conversation
UBsan report the following [1], when query does not contains any columns
from the dictionary:
```sql
SELECT
toUInt32(toUInt32(NULL, toUInt32(NULL, inf, NULL), NULL)),
toUInt32(toUInt32(toUInt32(toUInt32(toUInt32(NULL, 1., NULL)), toUInt32(toUInt32(NULL, 0.5, NULL)), toUInt32(NULL, NULL)), toUInt32(toUInt32(NULL, 1., NULL)), toUInt32(NULL, NULL)), toUInt32(toUInt32(toUInt32(toUInt32(NULL, 1000.0001220703125, NULL)), toUInt32(toUInt32(NULL, 10.000100135803223, NULL)), toUInt32(NULL, NULL)), NULL, NULL, NULL))
FROM somedict
```
```
std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> >::back() @ 0x128c07a6 in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/RangeDictionaryBlockInputStream.h:0: DB::RangeDictionaryBlockInputStream<DB::RangeHashedDictionary, unsigned short, unsigned long>::fillBlock(DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, DB::PODArray<unsigned short, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, DB::PODArray<unsigned short, 4096ul, Allocator<false, false>, 15ul, 16ul> const&) const @ 0x1692335e in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/RangeDictionaryBlockInputStream.h:0: DB::RangeDictionaryBlockInputStream<DB::RangeHashedDictionary, unsigned short, unsigned long>::getBlock(unsigned long, unsigned long) const @ 0x16922f96 in /workspace/clickhouse
./obj-x86_64-linux-gnu/../src/Dictionaries/DictionaryBlockInputStreamBase.cpp:23: DB::DictionaryBlockInputStreamBase::getHeader() const @ 0x166ab57c in /workspace/clickhouse
```
[1]: https://clickhouse-test-reports.s3.yandex.net/19451/64c0bf98290362fa216c05b070aa122a12af3c25/fuzzer_ubsan/report.html#fail1
kitaisreal
approved these changes
Feb 11, 2021
Member
Author
|
This was referenced Feb 12, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 12, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 12, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 12, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 12, 2021
This was referenced Feb 12, 2021
alexey-milovidov
added a commit
that referenced
this pull request
Feb 12, 2021
Backport #20345 to 21.2: Avoid invalid dereference in RANGE_HASHED() dictionary
alexey-milovidov
added a commit
that referenced
this pull request
Feb 12, 2021
Backport #20345 to 20.12: Avoid invalid dereference in RANGE_HASHED() dictionary
alexey-milovidov
added a commit
that referenced
this pull request
Feb 12, 2021
Backport #20345 to 21.1: Avoid invalid dereference in RANGE_HASHED() dictionary
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 15, 2021
kitaisreal
added a commit
that referenced
this pull request
Feb 17, 2021
Backport #20345 to 20.8: Avoid invalid dereference in RANGE_HASHED() dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Avoid invalid dereference in RANGE_HASHED() dictionary
Detailed description / Documentation draft:
UBsan report the following 1, when query does not contains any columns
from the dictionary: