fix:IRemoteObjectTranslateWhenRcv Security

Signed-off-by: hanlin15 <lihanlin15@huawei.com>
Change-Id: I319ca5f465441de97a078abe50c088be82c4bdd1
This commit is contained in:
hanlin15 2024-10-31 21:03:04 +08:00
parent bbe01f9223
commit 83fe79d5fb
2 changed files with 3 additions and 0 deletions

View File

@ -200,10 +200,12 @@ bool DBinderBaseInvoker<T>::IRemoteObjectTranslateWhenRcv(char *dataBuffer, bind
ZLOGE(LOG_LABEL, "fail to translate big raw data");
// do nothing
}
binderObject->handle = -1;
break;
}
default: {
ZLOGE(LOG_LABEL, "do not support this type:%{public}u of translation", binderObject->hdr.type);
binderObject->hdr.type = BINDER_TYPE_INVALID_TYPE;
// do nothing
break;
}

View File

@ -282,6 +282,7 @@ enum {
BINDER_TYPE_FDR = B_PACK_CHARS('f', 'd', 'r', B_TYPE_LARGE),
BINDER_TYPE_INVALID_HANDLE = B_PACK_CHARS('r', 'h', 'e', B_TYPE_LARGE),
BINDER_TYPE_INVALID_BINDER = B_PACK_CHARS('r', 'b', 'e', B_TYPE_LARGE),
BINDER_TYPE_INVALID_TYPE = B_PACK_CHARS('r', 't', 'e', B_TYPE_LARGE),
};
struct binder_ptr_count {