We identify some user data by recognizing both use of the get_user macro and assignment from __val_gu. However on most non-x86 architectures the get_user macro uses the variable __gu_val instead of __val_gu. Let's update handle_get_user to recognize that get_user may also use __gu_val. Signed-off-by: Andrew Murray <andrew.murray@xxxxxxx> --- check_get_user_overflow.c | 2 +- smatch_kernel_user_data.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check_get_user_overflow.c b/check_get_user_overflow.c index 20ec952c885a..fed299ee2300 100644 --- a/check_get_user_overflow.c +++ b/check_get_user_overflow.c @@ -108,7 +108,7 @@ static void match_assign(struct expression *expr) return; } name = expr_to_var(expr->right); - if (!name || strcmp(name, "__val_gu") != 0) + if (!name || (strcmp(name, "__val_gu") != 0 && strcmp(name, "__gu_val"))) goto free; set_state_expr(my_max_id, expr->left, &user_data); set_state_expr(my_min_id, expr->left, &user_data); diff --git a/smatch_kernel_user_data.c b/smatch_kernel_user_data.c index bc9298fd6312..7c5fb8d7d872 100644 --- a/smatch_kernel_user_data.c +++ b/smatch_kernel_user_data.c @@ -542,7 +542,7 @@ static int handle_get_user(struct expression *expr) return 0; name = expr_to_var(expr->right); - if (!name || strcmp(name, "__val_gu") != 0) + if (!name || (strcmp(name, "__val_gu") != 0 && strcmp(name, "__gu_val") != 0)) goto free; set_state_expr(my_id, expr->left, alloc_estate_whole(get_type(expr->left))); ret = 1; -- 2.21.0