1 #include "check_debug.h"
   2 
   3 int copy_from_user(void *dest, void *src, int size);
   4 
   5 struct my_struct {
   6         int x, y;
   7 };
   8 
   9 void *pointer;
  10 
  11 void copy_stuff(struct my_struct *foo)
  12 {
  13         copy_from_user(foo, pointer, sizeof(*foo));
  14 }
  15 
  16 void test(void)
  17 {
  18         struct my_struct foo;
  19 
  20         copy_stuff(&foo);
  21         __smatch_user_rl(foo.x);
  22 }
  23 /*
  24  * check-name: smatch user data #1
  25  * check-command: smatch -p=kernel -I.. sm_user_data1.c
  26  *
  27  * check-output-start
  28 sm_user_data1.c:21 test() user rl: 'foo.x' = 's32min-s32max'
  29  * check-output-end
  30  */