All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reshetova, Elena" <elena.reshetova@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "smatch@vger.kernel.org" <smatch@vger.kernel.org>,
	"Kleen, Andi" <andi.kleen@intel.com>
Subject: RE: Smatch mailing list archives
Date: Mon, 10 May 2021 06:17:27 +0000	[thread overview]
Message-ID: <CY4PR1101MB2326F1C6A54ADB4DB1F1E209E7549@CY4PR1101MB2326.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210508051626.GI1955@kadam>

> On Fri, May 07, 2021 at 02:22:37PM +0000, Reshetova, Elena wrote:
> > Hi,
> >
> > I have been working for a while now on a new smatch pattern, but
> > would really appreciate additional information points such as past
> > email discussions, etc.
> >
> > So I am wondering if there is a way to browse through
> > the archives of this mailing list in order to try to find the
> > information I need?
> 
> Sorry, I don't think it's archived anywhere.  There isn't a lot of
> traffic on the list.  About three times a year someone reports that
> Smatch is crashing for them.
> 
> I'm always happy to answer questions if there is any way I can help?

Thank you Dan! I am pretty new with smatch so that's why I was
hoping to browse through the existing mails to see if my simple questions
are already answered, but here is my current issue. 

What is the best way to create identifiers for the findings that certain smatch
pattern finds in the kernel? Let's say I have a new pattern that is able to find
different problematic places and report them in usual smatch way: errors and
warnings with file name, line number, function name, etc. 
Now for our pattern in order to be sure that the reported issue exists/does not
exists, somebody needs to go and look at the code manually and make a call. 
After this, it would be nice to mark this place as safe/concern in the report and be
able to transfer these results for kernel versions bumps (5.11->5.12, etc.) as soon as
the code in this function where finding was reported has not changed (and there
might be multiple findings per function).

What is the best way of doing it? 
I was first thinking of using some simple hash for the reported line (lines around, relative
position within the reported function),
but now I think I need also to hash the whole function in addition to the finding itself. 

Then the logic of transferring the result would be:

For each finding calculate: 
 1. finding_line_hash: the hash of the line that resulted in finding (becomes a unique id
     within the function).
2. finding_function_hash: the hash of the function that produced the finding (becomes a
   unique global id within the kernel) and helps to determine if the function has not been
   changed between the kernel versions. 

Logic for the result transfer: 

If both finding_line_hash and finding_function_hash match between the two smatch reports
for two different versions, then it is relatively safe to transfer this concrete smatch finding
and its manual audit result automatically.

Does it make sense overall? If yes, what is the easiest way in smatch to get hash data for 
1 and 2? I.e. get full reported line as a string and full function content as a string? 

Best Regards,
Elena.


  


  reply	other threads:[~2021-05-10  6:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CY4PR1101MB2326F684A9371A12746211FFE7579@CY4PR1101MB2326.namprd11.prod.outlook.com>
2021-05-07 14:22 ` Smatch mailing list archives Reshetova, Elena
2021-05-08  5:16   ` Dan Carpenter
2021-05-10  6:17     ` Reshetova, Elena [this message]
2021-05-10  6:59       ` Oleg Drokin
2021-05-10  9:31         ` Reshetova, Elena
2021-05-10 14:13           ` Oleg Drokin
2021-05-11 13:40             ` Dan Carpenter
2021-05-11 14:10             ` Reshetova, Elena
2021-05-10  7:20       ` Dan Carpenter
2021-05-10  9:43         ` Reshetova, Elena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR1101MB2326F1C6A54ADB4DB1F1E209E7549@CY4PR1101MB2326.namprd11.prod.outlook.com \
    --to=elena.reshetova@intel.com \
    --cc=andi.kleen@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=smatch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.