RE: [PATCH] smatch_kernel_host_data: enable additional debug
"Reshetova, Elena" <[email protected]> Tue, 28 Jun 2022 08:27:09 +0000
| Newsgroups | org.kernel.vger.smatch |
|---|---|
| Message-ID | <DM8PR11MB5750F0B17A16FDDBC66E1AEFE7B89@DM8PR11MB5750.namprd11.prod.outlook.com> |
> Hey Elena,
>
> I've pushed some changes to smatch_kernel_host_data.c and
> smatch_points_to_host_data.c. It hopefully just brings that code more
> in line with the user_data code.
Hi Dan,
Thank you very much for the fixes!
I am actually still planning to work on this further, especially I need to finish
re-writing the new pattern that produces the warning list for all host
input processing done in the code (we use this as a basis for our fuzzing coverage
analysis).
>
> The main thing is that smatch_points_to_host_data.c didn't differentiate
> between when the function gets host data from the user vs when it is
> passed in. That means if you have function:
>
> int *frob(int *x)
> {
> return x;
> }
>
> And one caller passes in host data then all of them get host data back.
> So then now we're passing host data pointers to even more functions and
> the problem gets worse and worse over time.
Yes, makes sense, I didn’t realize that this was happening with the previous code.
>
> Which is maybe not a huge deal in terms of the warnings generated, but
> it was taking 8GB of data in my database.
Oh, this is really bad for the database. I am sorry about this!
Best Regards,
Elena.
>
> regards,
> dan carpenter