user_data: make cross function tracking more specific
commit332aa13e2a1457114e27af14a04cb53a038d57f5
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Jun 2013 09:17:21 +0000 (17 12:17 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Jun 2013 09:17:21 +0000 (17 12:17 +0300)
treebd519018836d6274f457bb5e0d178fa6bcd10cb6
parent1128d90cc9ec4e27c6899489214a77f8c8196a95
user_data: make cross function tracking more specific

The we are processing looks like this:

copy_from_user(&kernel_struct, p, sizeof(&kernel_struct));

The old way Smatch handled this was that it marked kernel_struct as user
data.  The new way to handle this is to mark each of the members of
kernel_struct as user data.

In the old way, if we wanted to find if kernel_struct.xxx was user data
then we looked at "kernel_struct" but now we can look at
"kernel_struct.xxx" directly.

The second thing that this patch does is it changes how cross function
user_data is tracked.  At the end of the function we want to look at
which elements are user data.  The problem with the old code is that it
didn't distinguish between pointers that were user data because they were
user data when we passed them in and pointers where we copied user data to
them inside the function.  In the new code, we do care about that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_user_data.c