From: Takashi Iwai <tiwai@suse.de>
To: "Colin Ian King" <colin.king@canonical.com>
Cc: <alsa-devel@alsa-project.org>, "Jaroslav Kysela" <perex@perex.cz>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: static analysis bug report: ALSA: swapped client and port arguments in calls to snd_seq_oss_fill_addr
Date: Fri, 28 Jun 2019 11:22:50 +0200 [thread overview]
Message-ID: <s5hd0iy6p3p.wl-tiwai@suse.de> (raw)
In-Reply-To: <28c3fc44-0d4c-25e2-c9f4-d240c6d239f0@canonical.com>
On Thu, 27 Jun 2019 16:01:40 +0200,
Colin Ian King wrote:
>
> Hi there,
>
> Static analysis with Coverity has picked up two potential issues with
> the call to function snd_seq_oss_fill_addr. The prototype of
> snd_seq_oss_fill_addr is as follows:
>
> static inline void
> snd_seq_oss_fill_addr(struct seq_oss_devinfo *dp, struct snd_seq_event
> *ev,int dest_client, int dest_port)
>
>
> However, in sound/core/seq/oss/seq_oss_ioctl.c in function
> snd_seq_oss_oob_user it is being called as follows:
>
> snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.port, dp->addr.client);
>
> and also in sound/core/seq/oss/seq_oss_rw.c in function is it also being
> called as follows:
>
> snd_seq_oss_fill_addr(dp, &event, dp->addr.port, dp->addr.client);
>
> ..as one can see, in both cases the port and client arguments are
> swapped compared to the function prototype. I doubt this is intentional
> but you never know. Are these bugs?
That's a clear bug, the order should be (client, port), so it's bugs
in the caller side. They are rare use case, so probably no one really
hits or is annoyed -- the latter is a note-off just to be sure, and
the former is a special ioctl probably that has been never used :)
In anyway, would you send me a fix patch?
Thanks!
Takashi
>
> Colin
>
prev parent reply other threads:[~2019-06-28 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 14:01 Colin Ian King
2019-06-28 9:22 ` Takashi Iwai [this message]
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=s5hd0iy6p3p.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=colin.king@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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
all inboxes | Powered by JetHome®