-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-10200. OM may terminate due to NPE in S3SecretValue proto conversion
#6089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@ArafatKhan2198 can you please also take a look? |
myskov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
sadanand48
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adoroszlai the patch, LGTM
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adoroszlai , thanks for working on this! Just a few minor comments inlined.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/S3InMemoryCache.java
Show resolved
Hide resolved
| private boolean isDeleted; | ||
| private long transactionLogIndex; | ||
| private final String kerberosID; | ||
| private final String awsSecret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An unrelated comment: It is not a good idea store a secret in a plaintext String and write it to db.
The usual practice is to encrypt it in byte[] and erase it after use.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java
Outdated
Show resolved
Hide resolved
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the change looks good.
|
Thanks @myskov, @sadanand48, @szetszwo for the review. |
…ersion (apache#6089) (cherry picked from commit 9238be3)
…ersion (apache#6089) (cherry picked from commit 9238be3)
What changes were proposed in this pull request?
Revoked S3 secret is stored in the cache as
S3SecretValuewithnullsecret value. Since the object is mutable, other thread could access the same instance before revocation, and might encounter NPE while trying to convert to protobuf.was seen in
TestMultiTenantVolume(4 / 1000 runs).This PR changes
S3SecretValueto be immutable.https://issues.apache.org/jira/browse/HDDS-10200
How was this patch tested?
TestMultiTenantVolumepassed 10x100:https://github.com/adoroszlai/ozone/actions/runs/7645630287
Regular CI:
https://github.com/adoroszlai/ozone/actions/runs/7645622076