1 #include "check_debug.h"
4 unsigned char *head
, *data
;
5 unsigned short network_header
;
12 static inline unsigned char *skb_network_header(const struct sk_buff
*skb
)
14 return skb
->head
+ skb
->network_header
;
17 static inline int skb_network_offset(const struct sk_buff
*skb
)
19 return skb_network_header(skb
) - skb
->data
;
22 int frob(struct sk_buff
*skb
)
27 __smatch_user_rl(*skb
->data
);
28 __smatch_user_rl(skb
->data
+ 1);
29 __smatch_user_rl(*(int *)skb
->data
);
30 __smatch_user_rl(skb
->data
- skb_network_header(skb
));
33 x
= *(int *)skb
->data
;
36 __smatch_user_rl(p
->a
);
44 * check-name: smatch: userdata from skb
45 * check-command: smatch -p=kernel -I.. sm_skb2.c
48 sm_skb2.c:27 frob() user rl: '*skb->data' = '0-255'
49 sm_skb2.c:28 frob() user rl: 'skb->data + 1' = ''
50 sm_skb2.c:29 frob() user rl: '*skb->data' = 's32min-s32max'
51 sm_skb2.c:30 frob() user rl: 'skb->data - skb_network_header(skb)' = ''
52 sm_skb2.c:36 frob() user rl: 'p->a' = 's32min-s32max'
53 sm_skb2.c:37 frob() user rl: 'x' = 's32min-s32max'
54 sm_skb2.c:38 frob() user rl: 'y' = '0-255'