From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: alsa-devel@alsa-project.org,
Banajit Goswami <bgoswami@codeaurora.org>,
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Banajit Goswami <bgoswami@quicinc.com>
Subject: Re: [PATCH] ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp()
Date: Fri, 22 Jul 2022 09:30:22 +0300 [thread overview]
Message-ID: <20220722063022.GN2316@kadam> (raw)
In-Reply-To: <20220721104731.GK2316@kadam>
On Thu, Jul 21, 2022 at 01:47:31PM +0300, Dan Carpenter wrote:
> (Still takes overnight to run so I might end up sorely dissappointed
> and defeated tomorrow morning)
The generic test was pretty useless. :( Basically it was 117 false
positives. Attached.
There were thre main reasons for the false postives.
1) Smatch takes short cuts when dealing with loops.
2) Smatch doesn't understand threads so some code does.
msg.code = 0;
write_msg_and_wait_for_response(&msg);
return msg.code;
It's kind of useful to find these bugs in Smatch and I'll investigate
how to fix them. Another option would be to hack around the bugs by
just ignoring 0 and 1 returns.
if (rl_max(left_rl).value == 0 || rl_max(left_rl).value == 1)
return;
That would probably silence 90% of the false positives caused by 1 and
2.
3) A lot of code has harmless sanity checks:
size = get_size();
if (size > MAX)
return -EINVAL;
or:
size = get_size();
if (size > MAX)
size = MAX;
defeated. :(
regards,
dan carpenter
next prev parent reply other threads:[~2022-07-22 6:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 9:02 [PATCH] ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp() Christophe JAILLET
2022-07-21 10:00 ` Dan Carpenter
2022-07-21 10:30 ` Christophe JAILLET
2022-07-21 10:47 ` Dan Carpenter
2022-07-22 6:30 ` Dan Carpenter [this message]
2022-07-21 10:32 ` Dan Carpenter
2022-07-22 12:48 ` Mark Brown
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=20220722063022.GN2316@kadam \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox