Skip to content

Commit

Permalink
rpc-server: Disable parsing CKF_ARRAY_ATTRIBUTE
Browse files Browse the repository at this point in the history
This is a temporary measure to avoid oss-fuzz failure.  When the
attribute array is nested, the current internal API cannot determine
the actual size of data that need to be stored, because ulValueLen is
set to the attribute count times sizeof(CK_ATTRIBUTE).

Signed-off-by: Daiki Ueno <[email protected]>
  • Loading branch information
ueno committed May 24, 2021
1 parent 34b5687 commit b3243a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p11-kit/rpc-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ proto_read_attribute_array (p11_rpc_message *msg,
return PARSE_ERROR;
}

if (temp.type & CKF_ARRAY_ATTRIBUTE) {
p11_debug("recursive attribute array is not supported");
return PARSE_ERROR;
}

/* Try and stuff it in the output data */
if (arr) {
CK_ATTRIBUTE *attr = &(arr[i]);
Expand Down
5 changes: 5 additions & 0 deletions p11-kit/rpc-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ proto_read_attribute_array (p11_rpc_message *msg,
return PARSE_ERROR;
}

if (temp.type & CKF_ARRAY_ATTRIBUTE) {
p11_debug("recursive attribute array is not supported");
return PARSE_ERROR;
}

attrs[i].type = temp.type;

/* Whether this one is valid or not */
Expand Down

0 comments on commit b3243a7

Please sign in to comment.