Skip to content
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

app/vfe-vdpa: fix unknown feature bit crash #15

Merged

Conversation

LiZhang-2020
Copy link

It is NULL when feature bit unknown and causes crash.
Add check null and print unknown information in rpc message.

Signed-off-by: Li Zhang lizh@nvidia.com

@@ -76,7 +87,10 @@ static void vdpa_rpc_get_info(cJSON *obj, uint64_t val, const char **info,
for (i = 0; i < size; i++) {
if (!(val & (1ULL << i)))
continue;
JSON_NUM_STR_TO_OBJ(obj, i, "%5d", info[i]);
if (info[i])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF i > sizeof feature_names,
it will cross mem

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

It is NULL when feature bit unknown and causes crash.
Add check null and print unknown information in rpc message.

Signed-off-by: Li Zhang <lizh@nvidia.com>
@LiZhang-2020 LiZhang-2020 force-pushed the lizh-rpc-unknown-feature-bit-crash branch from f59e9f8 to d2f7447 Compare August 26, 2022 06:45
@kailiangz1 kailiangz1 merged commit b2da7d1 into Mellanox:main Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants