From: Alan Stern <stern@rowland.harvard.edu> To: Oliver Neukum <oneukum@suse.com> Cc: gregKH@linuxfoundation.org, miquel@df.uba.ar, linux-usb@vger.kernel.org Subject: [1/3] rio500: refuse more than one device at a time Date: Tue, 30 Apr 2019 10:47:26 -0400 (EDT) [thread overview] Message-ID: <Pine.LNX.4.44L0.1904301045260.1465-100000@iolanthe.rowland.org> (raw) On Tue, 30 Apr 2019, Oliver Neukum wrote: > This driver is using a global variable. It cannot handle more than > one device at a time. The issue has been exisying since the dawn s/exisying/existing/ > of the driver. > > Signed-off-by: Oliver Neukum <oneukum@suse.com> > Reported-by: syzbot+35f04d136fc975a70da4@syzkaller.appspotmail.com > --- > drivers/usb/misc/rio500.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c > index 13e4889bc34f..a4b6fbea975f 100644 > --- a/drivers/usb/misc/rio500.c > +++ b/drivers/usb/misc/rio500.c > @@ -449,7 +449,12 @@ static int probe_rio(struct usb_interface *intf, > struct rio_usb_data *rio = &rio_instance; > int retval; > > - dev_info(&intf->dev, "USB Rio found at address %d\n", dev->devnum); > + if (rio->present) { > + dev_info(&intf->dev, "Second USB Rio at address %d refused\n", dev->devnum); > + return -EBUSY; > + } else { > + dev_info(&intf->dev, "USB Rio found at address %d\n", dev->devnum); > + } This will race if more than one Rio is probed at the same time. You should hold the rio500_mutex throughout this routine. Alan Stern
WARNING: multiple messages have this Message-ID (diff)
From: Alan Stern <stern@rowland.harvard.edu> To: Oliver Neukum <oneukum@suse.com> Cc: gregKH@linuxfoundation.org, <miquel@df.uba.ar>, <linux-usb@vger.kernel.org> Subject: Re: [PATCH 1/3] rio500: refuse more than one device at a time Date: Tue, 30 Apr 2019 10:47:26 -0400 (EDT) [thread overview] Message-ID: <Pine.LNX.4.44L0.1904301045260.1465-100000@iolanthe.rowland.org> (raw) Message-ID: <20190430144726.D9CCrys3nget0TVVwM71cCc9nzuK_8oMstigujRzvV8@z> (raw) In-Reply-To: <20190430142326.25815-1-oneukum@suse.com> On Tue, 30 Apr 2019, Oliver Neukum wrote: > This driver is using a global variable. It cannot handle more than > one device at a time. The issue has been exisying since the dawn s/exisying/existing/ > of the driver. > > Signed-off-by: Oliver Neukum <oneukum@suse.com> > Reported-by: syzbot+35f04d136fc975a70da4@syzkaller.appspotmail.com > --- > drivers/usb/misc/rio500.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c > index 13e4889bc34f..a4b6fbea975f 100644 > --- a/drivers/usb/misc/rio500.c > +++ b/drivers/usb/misc/rio500.c > @@ -449,7 +449,12 @@ static int probe_rio(struct usb_interface *intf, > struct rio_usb_data *rio = &rio_instance; > int retval; > > - dev_info(&intf->dev, "USB Rio found at address %d\n", dev->devnum); > + if (rio->present) { > + dev_info(&intf->dev, "Second USB Rio at address %d refused\n", dev->devnum); > + return -EBUSY; > + } else { > + dev_info(&intf->dev, "USB Rio found at address %d\n", dev->devnum); > + } This will race if more than one Rio is probed at the same time. You should hold the rio500_mutex throughout this routine. Alan Stern
next reply other threads:[~2019-04-30 14:47 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-30 14:47 Alan Stern [this message] 2019-04-30 14:47 ` [PATCH 1/3] rio500: refuse more than one device at a time Alan Stern -- strict thread matches above, loose matches on Subject: below -- 2019-04-30 14:23 [3/3] rio500: simplify locking Oliver Neukum 2019-04-30 14:23 ` [PATCH 3/3] " Oliver Neukum 2019-04-30 14:23 [2/3] rio500: fix memeory leak in close after disconnect Oliver Neukum 2019-04-30 14:23 ` [PATCH 2/3] " Oliver Neukum 2019-04-30 14:23 [1/3] rio500: refuse more than one device at a time Oliver Neukum 2019-04-30 14:23 ` [PATCH 1/3] " Oliver Neukum
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=Pine.LNX.4.44L0.1904301045260.1465-100000@iolanthe.rowland.org \ --to=stern@rowland.harvard.edu \ --cc=gregKH@linuxfoundation.org \ --cc=linux-usb@vger.kernel.org \ --cc=miquel@df.uba.ar \ --cc=oneukum@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: linkBe 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.