type: make pointers unsigned
commit8eca6e312da1bffe86e8c18ee473a3c1ff6de157
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Feb 2019 18:59:50 +0000 (7 21:59 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Feb 2019 19:01:45 +0000 (7 22:01 +0300)
tree81af1eea7ebae44772ed76c931ea57bfcedf12e7
parentf0c7037ce2f1ed1d09ed8367e817e645656ab8b7
type: make pointers unsigned

In Sparse pointers are special and neither the signed nor the unsigned
bit is set.  By chance, I happened to make them signed in Smatch and then
I didn't change it because it was handy to have error pointer show up as
negatives.

But really pointers are unsigned.  So I have bit the bullet and changed it.
Part of what made me do this is the work with mtags.

One of the ideas that I had had was that the various segments and the stack
and the heap would all be indicated by the pointer range.  I never
implemented any checks which used this and really it never worked well.
You would get an unknown pointer and mark it as a general valid pointer
and that was that.

Then when I started using mtags, not all of them were in the valid pointer
range.

One thing I did is that error pointer are still marked as negative, but
they're at the high value side of the range instead of in front or middle.
It looks like this:  "0,4096-ptr_max,(-22),(-12)".

I've been running with this code for a while now and it seems basically
okay.  Hopefully, I manage to commit all the necessary parts.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_err_ptr_deref.c
check_kernel.c
smatch.h
smatch_address.c
smatch_extra.h
smatch_flow.c
smatch_ranges.c
smatch_sval.c
smatch_type.c