Michael Ho has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/3630

Change subject: IMPALA-3854: Fix use-after-free in HdfsTextScanner::Close()
......................................................................

IMPALA-3854: Fix use-after-free in HdfsTextScanner::Close()

A recent commit changed the ownership of the Stream object to
its owning ScannerContext. After that change, a Stream object
will be destroyed in ScannerContext::ReleaseCompletedResources()
if the parameter 'done' is true. That usually happens in the
Close() function of a scanner. However, for the text scanner,
the Stream object can be destroyed after handling compressed data
before Close() is called. In that case, the cached handle to the
Stream object is invalid when it's referenced in Close() to
access the compression codec of the Stream object.

This change fixes the above problem by using the existing field
'decompression_type_' in Close() which contains the compression
codec of the Stream object. In addition, the text scanner has been
modified to only free the Stream object in Close(). This avoids
other use-after-free problems in the code.

Change-Id: Ia88f6285563ff669ae215af22ed2d45e5398adae
---
M be/src/exec/hdfs-text-scanner.cc
M be/src/exec/scanner-context.h
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/30/3630/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3630
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia88f6285563ff669ae215af22ed2d45e5398adae
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <[email protected]>

Reply via email to