1 #include "check_debug.h"
3 void memset(void *ptr
, char c
, int size
){}
5 int copy_to_user(void *dest
, void *data
, int size
){}
6 int some_func(struct foo
*p
){}
8 typedef struct zr364xx_pipeinfo
{
24 struct foo global_dec
;
29 struct zr364xx_pipeinfo one
;
41 memset(&two
, 0, sizeof(two
));
45 eight
.x
= (four
.x
< 5 ? four
.x
: 5);
52 copy_to_user(ptr
, &p
->a
, sizeof(struct aa_policy
));
53 copy_to_user(ptr
, &global_dec
, sizeof(struct global_dec
));
54 copy_to_user(ptr
, &one
, sizeof(one
));
55 copy_to_user(ptr
, &two
, sizeof(two
));
56 copy_to_user(ptr
, &three
, sizeof(three
));
57 copy_to_user(ptr
, &four
, sizeof(four
));
58 copy_to_user(ptr
, &five
, sizeof(five
));
59 copy_to_user(ptr
, &six
, sizeof(six
));
60 copy_to_user(ptr
, &seven
, sizeof(seven
));
61 copy_to_user(ptr
, &eight
, sizeof(eight
));
62 copy_to_user(ptr
, &nine
, sizeof(nine
));
66 * check-name: Rosenberg Leaks
67 * check-command: smatch -p=kernel -I.. sm_rosenberg.c
70 sm_rosenberg.c:54 main() warn: check that 'one' doesn't leak information (struct has a hole after 'x')
71 sm_rosenberg.c:56 main() warn: check that 'three' doesn't leak information (struct has a hole after 'x')
72 sm_rosenberg.c:57 main() warn: check that 'four.y' doesn't leak information
73 sm_rosenberg.c:62 main() warn: check that 'nine.x' doesn't leak information