Commit a2a111ea authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

[AW] Check that the seed file descriptor is valid before making the getSeed AIDL call

We're seeing reports of IVariationsSeedServer.Stub.getSeed throwing a
RuntimeException due to being provided an invalid file descriptor. I
haven't been able to reproduce the issue locally, so this is a
speculative fix that catches the exception to prevent a crash.

We believe the crash is caused by the service dying and restarting, in
which case onServiceConnected will be called a second time. This CL
checks if the file descriptor is still valid before making the getSeed
call.

Test: Manually verify seeds can still be fetched correctly.
Bug: 1028004
Change-Id: I1b11911678e08883c95132eded2702a8b73c8a24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954352Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736646}
parent 6b33c8d1
...@@ -284,7 +284,10 @@ public class VariationsSeedLoader { ...@@ -284,7 +284,10 @@ public class VariationsSeedLoader {
@Override @Override
public void onServiceConnected(ComponentName name, IBinder service) { public void onServiceConnected(ComponentName name, IBinder service) {
try { try {
IVariationsSeedServer.Stub.asInterface(service).getSeed(mNewSeedFd, mOldSeedDate); if (mNewSeedFd.getFd() >= 0) {
IVariationsSeedServer.Stub.asInterface(service).getSeed(
mNewSeedFd, mOldSeedDate);
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Faild requesting seed", e); Log.e(TAG, "Faild requesting seed", e);
} finally { } finally {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment