impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-6281: Fix use-after-free in InitAuth()
Date Wed, 06 Dec 2017 22:13:00 GMT
Michael Ho has uploaded a new patch set (#2). ( )

Change subject: IMPALA-6281: Fix use-after-free in InitAuth()

IMPALA-6281: Fix use-after-free in InitAuth()

Previously, we implicitly create a local string object created from
the char* in argv[0] when calling InitAuth(). This string object goes
out of scope once InitAuth() returns but the pointer of this local
string's buffer is passed to the Sasl library which may reference
it after the local string has been deleted, leading to use-after-free.
This bug is exposed by recent change to enable Kerberos with KRPC as
we now always initialize Sasl even if Kerberos is not enabled.

This change fixes the problem above by making a copy of 'appname'
passed to InitAuth(). Also, the new code enforces that multiple
calls to InitAuth() must use the same 'appname' or it will fail.

Testing done: Verified rpc-mgr-test and thrift-server-test no longer
fail in ASAN build.

Change-Id: I1f29c2396df114264dfc23726b8ba778f50e12e9
M be/src/rpc/auth-provider.h
M be/src/rpc/
M be/src/rpc/
M be/src/rpc/
M be/src/transport/TSasl.h
M common/thrift/
6 files changed, 31 insertions(+), 15 deletions(-)

  git pull ssh:// refs/changes/77/8777/2
To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f29c2396df114264dfc23726b8ba778f50e12e9
Gerrit-Change-Number: 8777
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Ho <>
Gerrit-Reviewer: Joe McDonnell <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-Reviewer: Sailesh Mukil <>

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message