All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-safety@lists.elisa.tech, linux-usb@vger.kernel.org
Subject: Re: [linux-safety] [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error
Date: Mon, 12 Oct 2020 20:49:39 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2010122029540.17866@felia> (raw)
In-Reply-To: <CADVatmN7d+Oy5iHTUK=azHsvFq9+s0rdcjUTz5m_K4Xrf+JvZA@mail.gmail.com>



On Mon, 12 Oct 2020, Sudip Mukherjee wrote:

> 
> >
> > I am wondering if such comment deserves to be included if we cannot check
> > its validity later...
> 
> I am failing to understand why will you not be able to check its
> validity later. You just need to read the code to check it.
>

Well, I meant automatically checking the validity with some tool, like a 
tool (code analyzer, model checker, ...) that can check if a certain 
annotation holds.

> >
> > I would prefer a simple tool that could check that your basic assumption
> > on the code is valid and if it the basic assumption is still valid,
> > just shut up any stupid tool that simply does not get that these calls
> > here cannot return any error.
> >
> > We encountered this issue because of clang analyzer complaining, but it is
> > clear that it is a false positive of that (smart but) incomplete tool.
> 
> I dont think it is a false positive. The error return value is not
> checked and that is true. Only that it is not applicable because of
> the way the coding is done.
>

Maybe we have different understandings of a false positive reported by a 
tool...

My definitions are in the LPC 2020 presentation, Maintaining results from 
static analysis collaboratively, slide 4:
 
https://linuxplumbersconf.org/event/7/contributions/700/attachments/606/1088/LPC2020-Static-Analysis.pdf

So, for me, what you wrote above is exactly the definition of a
"False Tool Finding (False Positive, Type A)".

Given that Alan will accept to add a comment in the code, it is a "True 
Tool-Induced Change (True Positive, Type B)" because we can actually 
provide a reasonable patch based on what the tool reported (even though it 
is just supportive documentation, no change in the code).
 
> >
> > Do you intend to add comment for all false positives from all tools or are
> > we going to find a better solution than that?
> 
> I think tools will always give you some false positives and you will
> need to read the code to know if its false positive or not. I dont
> think there is any tool yet which will only give true positives.
>

Well, given humans provide some annotations to initially false positives, 
there is a fair chance that a tool only gives true positives after the 
annotations.

With 'just comments', the tool will continue to complain and we will need 
to read the code once again every time we did not know that that case was 
a false positive. That going to happen often, namely every time, a new 
developer looks at the tool report.

Let us check if an annotation can help beyond the current comment. This 
annotation can of course be provided later independently with another 
patch.

Lukas

  reply	other threads:[~2020-10-12 18:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 20:50 [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error Sudip Mukherjee
2020-10-12  0:27 ` Alan Stern
2020-10-12 14:11 ` [linux-safety] " Lukas Bulwahn
2020-10-12 14:11   ` Lukas Bulwahn
2020-10-12 14:57   ` Alan Stern
2020-10-12 15:10     ` Lukas Bulwahn
2020-10-12 15:10       ` Lukas Bulwahn
2020-10-12 15:18       ` Greg Kroah-Hartman
2020-10-12 18:25         ` Lukas Bulwahn
2020-10-12 18:25           ` Lukas Bulwahn
2020-10-13  5:23           ` Greg Kroah-Hartman
2020-10-13  5:37             ` Lukas Bulwahn
2020-10-13  5:37               ` Lukas Bulwahn
2020-10-13  6:36               ` Greg Kroah-Hartman
2020-10-13  7:16                 ` Lukas Bulwahn
2020-10-13  7:16                   ` Lukas Bulwahn
2020-10-13  7:35                   ` Greg Kroah-Hartman
2020-10-13  8:02                     ` Lukas Bulwahn
2020-10-13  8:02                       ` Lukas Bulwahn
2020-10-13  8:24               ` Sudip Mukherjee
2020-10-13  8:24                 ` Sudip Mukherjee
2020-10-13  8:36                 ` Lukas Bulwahn
2020-10-13  8:36                   ` Lukas Bulwahn
2020-10-12 16:00       ` Alan Stern
2020-10-12 18:17         ` Lukas Bulwahn
2020-10-12 18:17           ` Lukas Bulwahn
2020-10-13  5:21           ` Greg Kroah-Hartman
2020-10-13  5:41             ` Lukas Bulwahn
2020-10-13  5:41               ` Lukas Bulwahn
2020-10-12 15:24   ` Sudip Mukherjee
2020-10-12 15:24     ` Sudip Mukherjee
2020-10-12 18:49     ` Lukas Bulwahn [this message]
2020-10-12 18:49       ` Lukas Bulwahn

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=alpine.DEB.2.21.2010122029540.17866@felia \
    --to=lukas.bulwahn@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-safety@lists.elisa.tech \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=sudipm.mukherjee@gmail.com \
    /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.