2 * Copyright (C) 2011 Dan Carpenter.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
19 * There are a couple checks that try to see if a variable
20 * comes from the user. It would be better to unify them
21 * into one place. Also it we should follow the data down
22 * the call paths. Hence this file.
26 #include "smatch_slist.h"
27 #include "smatch_extra.h"
30 static int my_call_id
;
33 static bool func_gets_user_data
;
35 static const char * kstr_funcs
[] = {
36 "kstrtoull", "kstrtoll", "kstrtoul", "kstrtol", "kstrtouint",
37 "kstrtoint", "kstrtou64", "kstrtos64", "kstrtou32", "kstrtos32",
38 "kstrtou16", "kstrtos16", "kstrtou8", "kstrtos8", "kstrtoull_from_user"
39 "kstrtoll_from_user", "kstrtoul_from_user", "kstrtol_from_user",
40 "kstrtouint_from_user", "kstrtoint_from_user", "kstrtou16_from_user",
41 "kstrtos16_from_user", "kstrtou8_from_user", "kstrtos8_from_user",
42 "kstrtou64_from_user", "kstrtos64_from_user", "kstrtou32_from_user",
43 "kstrtos32_from_user",
46 static void set_points_to_user_data(struct expression
*expr
);
48 static struct stree
*start_states
;
49 static struct stree_stack
*saved_stack
;
50 static void save_start_states(struct statement
*stmt
)
52 start_states
= clone_stree(__get_cur_stree());
55 static void free_start_states(void)
57 free_stree(&start_states
);
60 static void match_save_states(struct expression
*expr
)
62 push_stree(&saved_stack
, start_states
);
66 static void match_restore_states(struct expression
*expr
)
68 free_stree(&start_states
);
69 start_states
= pop_stree(&saved_stack
);
72 static struct smatch_state
*empty_state(struct sm_state
*sm
)
74 return alloc_estate_empty();
77 static void pre_merge_hook(struct sm_state
*sm
)
79 struct smatch_state
*user
;
80 struct smatch_state
*extra
;
81 struct range_list
*rl
;
84 extra
= get_state(SMATCH_EXTRA
, sm
->name
, sm
->sym
);
85 if (!extra
|| !estate_rl(extra
))
87 user
= get_state(my_id
, sm
->name
, sm
->sym
);
88 if (!user
|| !estate_rl(user
))
90 rl
= rl_intersection(estate_rl(user
), estate_rl(extra
));
91 if (rl_to_sval(rl
, &dummy
))
93 set_state(my_id
, sm
->name
, sm
->sym
, alloc_estate_rl(clone_rl(rl
)));
96 static void tag_inner_struct_members(struct expression
*expr
, struct symbol
*member
)
98 struct expression
*edge_member
;
99 struct symbol
*base
= get_real_base_type(member
);
103 expr
= member_expression(expr
, '.', member
->ident
);
105 FOR_EACH_PTR(base
->symbol_list
, tmp
) {
108 type
= get_real_base_type(tmp
);
112 if (type
->type
== SYM_UNION
|| type
->type
== SYM_STRUCT
) {
113 tag_inner_struct_members(expr
, tmp
);
120 edge_member
= member_expression(expr
, '.', tmp
->ident
);
121 set_state_expr(my_id
, edge_member
, alloc_estate_whole(type
));
122 } END_FOR_EACH_PTR(tmp
);
125 static void tag_struct_members(struct symbol
*type
, struct expression
*expr
)
128 struct expression
*member
;
131 if (expr
->type
== EXPR_PREOP
&& expr
->op
== '&') {
132 expr
= strip_expr(expr
->unop
);
136 FOR_EACH_PTR(type
->symbol_list
, tmp
) {
137 type
= get_real_base_type(tmp
);
141 if (type
->type
== SYM_UNION
|| type
->type
== SYM_STRUCT
) {
142 tag_inner_struct_members(expr
, tmp
);
149 member
= member_expression(expr
, op
, tmp
->ident
);
150 set_state_expr(my_id
, member
, alloc_estate_whole(get_type(member
)));
152 if (type
->type
== SYM_ARRAY
)
153 set_points_to_user_data(member
);
154 } END_FOR_EACH_PTR(tmp
);
157 static void tag_base_type(struct expression
*expr
)
159 if (expr
->type
== EXPR_PREOP
&& expr
->op
== '&')
160 expr
= strip_expr(expr
->unop
);
162 expr
= deref_expression(expr
);
163 set_state_expr(my_id
, expr
, alloc_estate_whole(get_type(expr
)));
166 static void tag_as_user_data(struct expression
*expr
)
170 expr
= strip_expr(expr
);
172 type
= get_type(expr
);
173 if (!type
|| type
->type
!= SYM_PTR
)
175 type
= get_real_base_type(type
);
178 if (type
== &void_ctype
) {
179 set_state_expr(my_id
, deref_expression(expr
), alloc_estate_whole(&ulong_ctype
));
182 if (type
->type
== SYM_BASETYPE
)
184 if (type
->type
== SYM_STRUCT
|| type
->type
== SYM_UNION
) {
185 if (expr
->type
!= EXPR_PREOP
|| expr
->op
!= '&')
186 expr
= deref_expression(expr
);
188 set_state_expr(my_id
, deref_expression(expr
), alloc_estate_whole(&ulong_ctype
));
189 tag_struct_members(type
, expr
);
193 static void match_user_copy(const char *fn
, struct expression
*expr
, void *_param
)
195 int param
= PTR_INT(_param
);
196 struct expression
*dest
;
198 func_gets_user_data
= true;
200 dest
= get_argument_from_call_expr(expr
->args
, param
);
201 dest
= strip_expr(dest
);
204 tag_as_user_data(dest
);
207 static void match_sscanf(const char *fn
, struct expression
*expr
, void *unused
)
209 struct expression
*arg
;
212 func_gets_user_data
= true;
215 FOR_EACH_PTR(expr
->args
, arg
) {
219 tag_as_user_data(arg
);
220 } END_FOR_EACH_PTR(arg
);
223 static int points_to_user_data(struct expression
*expr
)
225 struct smatch_state
*state
;
231 expr
= strip_expr(expr
);
233 if (expr
->type
== EXPR_BINOP
&& expr
->op
== '+') {
234 if (points_to_user_data(expr
->left
))
236 if (points_to_user_data(expr
->right
))
241 name
= expr_to_var_sym(expr
, &sym
);
244 snprintf(buf
, sizeof(buf
), "*%s", name
);
245 state
= get_state(my_id
, buf
, sym
);
246 if (state
&& estate_rl(state
))
253 static void set_points_to_user_data(struct expression
*expr
)
259 name
= expr_to_var_sym(expr
, &sym
);
262 snprintf(buf
, sizeof(buf
), "*%s", name
);
263 set_state(my_id
, buf
, sym
, alloc_estate_whole(&llong_ctype
));
268 static int is_skb_data(struct expression
*expr
)
272 if (expr
->type
== EXPR_BINOP
&& expr
->op
== '+')
273 return is_skb_data(expr
->left
);
275 expr
= strip_expr(expr
);
278 if (expr
->type
!= EXPR_DEREF
|| expr
->op
!= '.')
283 if (strcmp(expr
->member
->name
, "data") != 0)
286 sym
= expr_to_sym(expr
->deref
);
289 sym
= get_real_base_type(sym
);
290 if (!sym
|| sym
->type
!= SYM_PTR
)
292 sym
= get_real_base_type(sym
);
293 if (!sym
|| sym
->type
!= SYM_STRUCT
|| !sym
->ident
)
295 if (strcmp(sym
->ident
->name
, "sk_buff") != 0)
301 static int comes_from_skb_data(struct expression
*expr
)
303 expr
= strip_expr(expr
);
304 if (!expr
|| expr
->type
!= EXPR_PREOP
|| expr
->op
!= '*')
307 expr
= strip_expr(expr
->unop
);
310 if (expr
->type
== EXPR_BINOP
&& expr
->op
== '+')
311 expr
= strip_expr(expr
->left
);
313 return is_skb_data(expr
);
316 static int handle_struct_assignment(struct expression
*expr
)
318 struct expression
*right
;
319 struct symbol
*left_type
, *right_type
;
321 left_type
= get_type(expr
->left
);
322 if (!left_type
|| left_type
->type
!= SYM_PTR
)
324 left_type
= get_real_base_type(left_type
);
327 if (left_type
->type
!= SYM_STRUCT
&&
328 left_type
->type
!= SYM_UNION
)
332 * Ignore struct to struct assignments because for those we look at the
333 * individual members.
335 right
= strip_expr(expr
->right
);
336 right_type
= get_type(right
);
337 if (!right_type
|| right_type
->type
!= SYM_PTR
)
340 /* If we are assigning struct members then normally that is handled
341 * by fake assignments, however if we cast one struct to a different
342 * of struct then we handle that here.
344 right_type
= get_real_base_type(right_type
);
345 if (right_type
== left_type
)
348 if (!points_to_user_data(right
) && !is_skb_data(right
))
351 tag_as_user_data(expr
->left
);
355 static int handle_get_user(struct expression
*expr
)
360 name
= get_macro_name(expr
->pos
);
361 if (!name
|| strcmp(name
, "get_user") != 0)
364 name
= expr_to_var(expr
->right
);
365 if (!name
|| strcmp(name
, "__val_gu") != 0)
367 set_state_expr(my_id
, expr
->left
, alloc_estate_whole(get_type(expr
->left
)));
374 static void match_assign(struct expression
*expr
)
376 struct range_list
*rl
;
378 if (is_fake_call(expr
->right
))
380 if (handle_get_user(expr
))
382 if (points_to_user_data(expr
->right
))
383 set_points_to_user_data(expr
->left
);
384 if (handle_struct_assignment(expr
))
387 if (!get_user_rl(expr
->right
, &rl
))
388 goto clear_old_state
;
390 rl
= cast_rl(get_type(expr
->left
), rl
);
391 set_state_expr(my_id
, expr
->left
, alloc_estate_rl(rl
));
396 if (get_state_expr(my_id
, expr
->left
))
397 set_state_expr(my_id
, expr
->left
, alloc_estate_empty());
400 static void match_condition(struct expression
*expr
)
402 struct smatch_state
*left_orig
= NULL
;
403 struct smatch_state
*right_orig
= NULL
;
405 if (expr
->type
!= EXPR_COMPARE
)
407 if (expr
->op
!= SPECIAL_EQUAL
&&
408 expr
->op
!= SPECIAL_NOTEQUAL
)
411 left_orig
= get_state_expr(my_id
, expr
->left
);
412 right_orig
= get_state_expr(my_id
, expr
->right
);
414 if (!left_orig
&& !right_orig
)
416 if (left_orig
&& right_orig
)
420 set_true_false_states_expr(my_id
, expr
->left
,
421 expr
->op
== SPECIAL_EQUAL
? alloc_estate_empty() : NULL
,
422 expr
->op
== SPECIAL_EQUAL
? NULL
: alloc_estate_empty());
424 set_true_false_states_expr(my_id
, expr
->right
,
425 expr
->op
== SPECIAL_EQUAL
? alloc_estate_empty() : NULL
,
426 expr
->op
== SPECIAL_EQUAL
? NULL
: alloc_estate_empty());
430 static void match_user_assign_function(const char *fn
, struct expression
*expr
, void *unused
)
432 func_gets_user_data
= true;
434 tag_as_user_data(expr
->left
);
435 set_points_to_user_data(expr
->left
);
438 static void match_simple_strtoul(const char *fn
, struct expression
*expr
, void *unused
)
440 func_gets_user_data
= true;
442 set_state_expr(my_id
, expr
->left
, alloc_estate_whole(get_type(expr
->left
)));
445 static int get_user_macro_rl(struct expression
*expr
, struct range_list
**rl
)
451 macro
= get_macro_name(expr
->pos
);
456 if (strcmp(macro
, "ntohl") == 0) {
457 *rl
= alloc_whole_rl(&uint_ctype
);
460 if (strcmp(macro
, "ntohs") == 0) {
461 *rl
= alloc_whole_rl(&ushort_ctype
);
468 struct range_list
*rl
;
469 struct expression
*call
;
471 static int returned_rl_callback(void *_info
, int argc
, char **argv
, char **azColName
)
473 struct db_info
*db_info
= _info
;
474 struct range_list
*rl
;
475 char *return_ranges
= argv
[0];
476 char *user_ranges
= argv
[1];
477 struct expression
*arg
;
483 call_results_to_rl(db_info
->call
, get_type(db_info
->call
), user_ranges
, &rl
);
484 if (str_to_comparison_arg(return_ranges
, db_info
->call
, &comparison
, &arg
) &&
485 comparison
== SPECIAL_EQUAL
) {
486 struct range_list
*orig_rl
;
488 if (!get_user_rl(arg
, &orig_rl
))
490 rl
= rl_intersection(rl
, orig_rl
);
494 db_info
->rl
= rl_union(db_info
->rl
, rl
);
499 static int has_user_data(struct symbol
*sym
)
501 struct sm_state
*tmp
;
503 FOR_EACH_MY_SM(my_id
, __get_cur_stree(), tmp
) {
506 } END_FOR_EACH_SM(tmp
);
510 static int we_pass_user_data(struct expression
*call
)
512 struct expression
*arg
;
515 FOR_EACH_PTR(call
->args
, arg
) {
516 sym
= expr_to_sym(arg
);
519 if (has_user_data(sym
))
521 } END_FOR_EACH_PTR(arg
);
526 static int db_returned_user_rl(struct expression
*call
, struct range_list
**rl
)
528 struct db_info db_info
= {};
530 /* for function pointers assume everything is used */
531 if (call
->fn
->type
!= EXPR_SYMBOL
)
533 if (is_fake_call(call
))
537 run_sql(&returned_rl_callback
, &db_info
,
538 "select return, value from return_states where %s and type = %d and parameter = -1 and key = '$';",
539 get_static_filter(call
->fn
->symbol
), USER_DATA3_SET
);
541 func_gets_user_data
= true;
546 run_sql(&returned_rl_callback
, &db_info
,
547 "select return, value from return_states where %s and type = %d and parameter = -1 and key = '$';",
548 get_static_filter(call
->fn
->symbol
), USER_DATA3
);
550 if (!we_pass_user_data(call
))
559 static int user_data_flag
;
560 static struct range_list
*var_user_rl(struct expression
*expr
)
562 struct smatch_state
*state
;
563 struct range_list
*rl
;
564 struct range_list
*absolute_rl
;
566 if (get_user_macro_rl(expr
, &rl
))
569 if (comes_from_skb_data(expr
)) {
570 rl
= alloc_whole_rl(get_type(expr
));
574 state
= get_state_expr(my_id
, expr
);
575 if (state
&& estate_rl(state
)) {
576 rl
= estate_rl(state
);
580 if (expr
->type
== EXPR_CALL
&& db_returned_user_rl(expr
, &rl
))
586 absolute_rl
= var_to_absolute_rl(expr
);
587 return clone_rl(rl_intersection(rl
, absolute_rl
));
590 int get_user_rl(struct expression
*expr
, struct range_list
**rl
)
594 custom_get_absolute_rl(expr
, &var_user_rl
, rl
);
595 if (!user_data_flag
) {
602 int get_user_rl_var_sym(const char *name
, struct symbol
*sym
, struct range_list
**rl
)
604 struct smatch_state
*state
;
606 state
= get_state(my_id
, name
, sym
);
607 if (state
&& estate_rl(state
)) {
608 *rl
= estate_rl(state
);
614 static void match_call_info(struct expression
*expr
)
616 struct range_list
*rl
;
617 struct expression
*arg
;
621 FOR_EACH_PTR(expr
->args
, arg
) {
624 if (!get_user_rl(arg
, &rl
))
627 sql_insert_caller_info(expr
, USER_DATA3
, i
, "$", show_rl(rl
));
628 } END_FOR_EACH_PTR(arg
);
631 static void struct_member_callback(struct expression
*call
, int param
, char *printed_name
, struct sm_state
*sm
)
633 struct smatch_state
*state
;
634 struct range_list
*rl
;
636 if (strcmp(sm
->state
->name
, "") == 0)
639 state
= get_state(SMATCH_EXTRA
, sm
->name
, sm
->sym
);
640 if (!state
|| !estate_rl(state
))
641 rl
= estate_rl(sm
->state
);
643 rl
= rl_intersection(estate_rl(sm
->state
), estate_rl(state
));
645 sql_insert_caller_info(call
, USER_DATA3
, param
, printed_name
, show_rl(rl
));
648 static void set_param_user_data(const char *name
, struct symbol
*sym
, char *key
, char *value
)
650 struct range_list
*rl
= NULL
;
651 struct smatch_state
*state
;
655 if (strcmp(key
, "*$") == 0)
656 snprintf(fullname
, sizeof(fullname
), "*%s", name
);
657 else if (strncmp(key
, "$", 1) == 0)
658 snprintf(fullname
, 256, "%s%s", name
, key
+ 1);
662 type
= get_member_type_from_key(symbol_expression(sym
), key
);
664 /* if the caller passes a void pointer with user data */
665 if (strcmp(key
, "*$") == 0 && type
&& type
!= &void_ctype
) {
666 struct expression
*expr
= symbol_expression(sym
);
668 tag_as_user_data(expr
);
669 set_points_to_user_data(expr
);
672 str_to_rl(type
, value
, &rl
);
673 state
= alloc_estate_rl(rl
);
674 set_state(my_id
, fullname
, sym
, state
);
677 static void set_called(const char *name
, struct symbol
*sym
, char *key
, char *value
)
679 set_state(my_call_id
, "this_function", NULL
, &called
);
682 static void match_syscall_definition(struct symbol
*sym
)
689 macro
= get_macro_name(sym
->pos
);
691 (strncmp("SYSCALL_DEFINE", macro
, strlen("SYSCALL_DEFINE")) == 0 ||
692 strncmp("COMPAT_SYSCALL_DEFINE", macro
, strlen("COMPAT_SYSCALL_DEFINE")) == 0))
695 name
= get_function();
696 if (!option_no_db
&& get_state(my_call_id
, "this_function", NULL
) != &called
) {
697 if (name
&& strncmp(name
, "sys_", 4) == 0)
701 if (name
&& strncmp(name
, "compat_sys_", 11) == 0)
707 FOR_EACH_PTR(sym
->ctype
.base_type
->arguments
, arg
) {
708 set_state(my_id
, arg
->ident
->name
, arg
, alloc_estate_whole(get_real_base_type(arg
)));
709 } END_FOR_EACH_PTR(arg
);
712 static void set_to_user_data(struct expression
*expr
, char *key
, char *value
)
717 struct range_list
*rl
= NULL
;
719 type
= get_member_type_from_key(expr
, key
);
720 name
= get_variable_from_key(expr
, key
, &sym
);
724 call_results_to_rl(expr
, type
, value
, &rl
);
726 set_state(my_id
, name
, sym
, alloc_estate_rl(rl
));
732 static void returns_param_user_data(struct expression
*expr
, int param
, char *key
, char *value
)
734 struct expression
*arg
;
735 struct expression
*call
;
738 while (call
->type
== EXPR_ASSIGNMENT
)
739 call
= strip_expr(call
->right
);
740 if (call
->type
!= EXPR_CALL
)
743 if (!we_pass_user_data(call
))
747 if (expr
->type
!= EXPR_ASSIGNMENT
)
749 set_to_user_data(expr
->left
, key
, value
);
753 arg
= get_argument_from_call_expr(call
->args
, param
);
756 set_to_user_data(arg
, key
, value
);
759 static void returns_param_user_data_set(struct expression
*expr
, int param
, char *key
, char *value
)
761 struct expression
*arg
;
763 func_gets_user_data
= true;
766 if (expr
->type
!= EXPR_ASSIGNMENT
)
768 set_to_user_data(expr
->left
, key
, value
);
772 while (expr
->type
== EXPR_ASSIGNMENT
)
773 expr
= strip_expr(expr
->right
);
774 if (expr
->type
!= EXPR_CALL
)
777 arg
= get_argument_from_call_expr(expr
->args
, param
);
780 set_to_user_data(arg
, key
, value
);
783 static int has_empty_state(struct sm_state
*sm
)
785 struct sm_state
*tmp
;
787 FOR_EACH_PTR(sm
->possible
, tmp
) {
788 if (!estate_rl(tmp
->state
))
790 } END_FOR_EACH_PTR(tmp
);
795 static void param_set_to_user_data(int return_id
, char *return_ranges
, struct expression
*expr
)
798 struct smatch_state
*start_state
;
799 struct range_list
*rl
;
801 const char *param_name
;
803 FOR_EACH_MY_SM(my_id
, __get_cur_stree(), sm
) {
804 if (has_empty_state(sm
))
807 param
= get_param_num_from_sym(sm
->sym
);
809 if (expr_to_sym(expr
) == sm
->sym
)
815 /* The logic here was that if we were passed in a user data then
816 * we don't record that. It's like the difference between
817 * param_filter and param_set. When I think about it, I'm not
818 * sure it actually works. It's probably harmless because we
819 * checked earlier that we're not returning a parameter...
820 * Let's mark this as a TODO.
822 start_state
= get_state_stree(start_states
, my_id
, sm
->name
, sm
->sym
);
823 if (start_state
&& rl_equiv(estate_rl(sm
->state
), estate_rl(start_state
)))
826 param_name
= get_param_name(sm
);
829 if (strcmp(param_name
, "$") == 0)
832 sql_insert_return_states(return_id
, return_ranges
,
833 func_gets_user_data
? USER_DATA3_SET
: USER_DATA3
,
834 param
, param_name
, show_rl(estate_rl(sm
->state
)));
835 } END_FOR_EACH_SM(sm
);
837 if (get_user_rl(expr
, &rl
)) {
838 sql_insert_return_states(return_id
, return_ranges
,
839 func_gets_user_data
? USER_DATA3_SET
: USER_DATA3
,
840 -1, "$", show_rl(rl
));
844 static struct int_stack
*gets_data_stack
;
845 static void match_function_def(struct symbol
*sym
)
847 func_gets_user_data
= false;
850 static void match_inline_start(struct expression
*expr
)
852 push_int(&gets_data_stack
, func_gets_user_data
);
855 static void match_inline_end(struct expression
*expr
)
857 func_gets_user_data
= pop_int(&gets_data_stack
);
860 void check_user_data2(int id
)
866 if (option_project
!= PROJ_KERNEL
)
869 add_hook(&match_function_def
, FUNC_DEF_HOOK
);
870 add_hook(&match_inline_start
, INLINE_FN_START
);
871 add_hook(&match_inline_end
, INLINE_FN_END
);
873 add_hook(&save_start_states
, AFTER_DEF_HOOK
);
874 add_hook(&free_start_states
, AFTER_FUNC_HOOK
);
875 add_hook(&match_save_states
, INLINE_FN_START
);
876 add_hook(&match_restore_states
, INLINE_FN_END
);
878 add_unmatched_state_hook(my_id
, &empty_state
);
879 add_pre_merge_hook(my_id
, &pre_merge_hook
);
880 add_merge_hook(my_id
, &merge_estates
);
882 add_function_hook("copy_from_user", &match_user_copy
, INT_PTR(0));
883 add_function_hook("__copy_from_user", &match_user_copy
, INT_PTR(0));
884 add_function_hook("memcpy_fromiovec", &match_user_copy
, INT_PTR(0));
885 for (i
= 0; i
< ARRAY_SIZE(kstr_funcs
); i
++)
886 add_function_hook(kstr_funcs
[i
], &match_user_copy
, INT_PTR(2));
888 add_function_assign_hook("simple_strtol", &match_simple_strtoul
, NULL
);
889 add_function_assign_hook("simple_strtoll", &match_simple_strtoul
, NULL
);
890 add_function_assign_hook("simple_strtoul", &match_simple_strtoul
, NULL
);
891 add_function_assign_hook("simple_strtoull", &match_simple_strtoul
, NULL
);
893 add_function_hook("sscanf", &match_sscanf
, NULL
);
895 add_function_assign_hook("memdup_user", &match_user_assign_function
, NULL
);
896 add_function_assign_hook("kmap_atomic", &match_user_assign_function
, NULL
);
897 add_function_assign_hook("skb_network_header", &match_user_assign_function
, NULL
);
899 add_hook(&match_syscall_definition
, AFTER_DEF_HOOK
);
901 add_hook(&match_assign
, ASSIGNMENT_HOOK
);
902 add_hook(&match_condition
, CONDITION_HOOK
);
904 add_hook(&match_call_info
, FUNCTION_CALL_HOOK
);
905 add_member_info_callback(my_id
, struct_member_callback
);
906 select_caller_info_hook(set_param_user_data
, USER_DATA3
);
907 select_return_states_hook(USER_DATA3
, &returns_param_user_data
);
908 select_return_states_hook(USER_DATA3_SET
, &returns_param_user_data_set
);
909 add_split_return_callback(¶m_set_to_user_data
);
912 void check_user_data3(int id
)
916 if (option_project
!= PROJ_KERNEL
)
918 select_caller_info_hook(set_called
, INTERNAL
);